Hi Dan,
On 7/10/2026 12:04 PM, Dan Carpenter wrote:
> 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:289
> dw_hdmi_rockchip_get_bus_format()
> warn: 'bridge_state' is an error pointer or valid
>
> 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)
>
> drm_atomic_get_bridge_state() never returns NULL, only error pointers.
This issue has already been addressed in the patch "drm/rockchip:
dw_hdmi: Fix error handling for drm_atomic_get_bridge_state()" at [1].
[1] https://patch.msgid.link/[email protected]/
Regards,
Jonas
>
> 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