[bug report] drm/rockchip: dw_hdmi: Propagate bus format to display driver

Dan Carpenter <[email protected]>
Newsgroups org.infradead.lists.linux-rockchip
Message-ID <[email protected]>
Hello Jonas Karlman,

Commit dc70272cc184 ("drm/rockchip: dw_hdmi: Propagate bus format to
display driver") from May 18, 2026 (linux-next), leads to the
following Smatch static checker warning:

	drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c:292 dw_hdmi_rockchip_get_bus_format()
	error: 'bridge_state' dereferencing possible ERR_PTR()

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
    278 static u32 dw_hdmi_rockchip_get_bus_format(struct drm_encoder *encoder,
    279                                            struct drm_connector_state *conn_state)
    280 {
    281         struct drm_bridge *bridge __free(drm_bridge_put) = NULL;
    282         struct drm_bridge_state *bridge_state;
    283 
    284         bridge = drm_bridge_chain_get_first_bridge(encoder);
    285         if (!bridge)
    286                 return 0;
    287 
    288         bridge_state = drm_atomic_get_bridge_state(conn_state->state, bridge);
    289         if (!bridge_state)

This should be if (IS_ERR(bridge_state)).

    290                 return 0;
    291 
--> 292         if (bridge_state->input_bus_cfg.format != MEDIA_BUS_FMT_FIXED)
    293                 return bridge_state->input_bus_cfg.format;
    294 
    295         return bridge_state->output_bus_cfg.format;
    296 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.