The drm_atomic_get_bridge_state() function returns an error pointer on
failure, not NULL. Fix the check to use IS_ERR() to correctly handle
allocation failures.
Fixes: dc70272cc184 ("drm/rockchip: dw_hdmi: Propagate bus format to display
driver")
Signed-off-by: Chen Ni <[email protected]>
---
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index cffc0af5190f..766cf21a4be7 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -287,7 +287,7 @@ static u32 dw_hdmi_rockchip_get_bus_format(struct
drm_encoder *encoder,
return 0;
bridge_state = drm_atomic_get_bridge_state(conn_state->state, bridge);
- if (!bridge_state)
+ if (IS_ERR(bridge_state))
return 0;
if (bridge_state->input_bus_cfg.format != MEDIA_BUS_FMT_FIXED)
--
2.25.1