mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
Callers of of_drm_find_panel() and drm_of_find_panel_or_bridge() receive a pointer with no reference held, creating a window where the panel device can be unregistered and freed between the lookup and first use (e.g., drm_panel_prepare()). Fix the lookup function by acquiring a reference with drm_panel_get() before returning, under panel_lock. Callers are now responsible for calling drm_panel_put() when they no longer need the pointer. For bridge drivers that immediately wrap the panel in a panel_bridge (which acquires its own reference), release the lookup reference right after the bridge creation call. For analogix-anx6345, which stores the panel for direct use, release the reference in the i2c remove path. For platform drivers using analogix_dp_core with a component lifecycle (exynos_dp, rockchip analogix_dp), release the lookup reference in the platform remove() function. The panel_bridge created during bind() holds a separate reference that devm cleanup releases after remove() returns. Also fix devm_drm_of_get_bridge() and drmm_of_get_bridge() in bridge/panel.c itself, update a second batch of drivers calling of_drm_find_panel() or drm_of_find_panel_or_bridge() to release the lookup reference after wrapping the panel in a bridge, and handle the cases where a panel is found but cannot be used, dropping the reference immediately in those paths. Assisted-by: Claude:claude-opus-4-6 Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Albert Esteve <aesteve@redhat.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260717-drm_refcount_wiring-v3-3-023900c32e01@redhat.com |
||
|---|---|---|
| .. | ||
| fsl_dcu_drm_crtc.c | ||
| fsl_dcu_drm_crtc.h | ||
| fsl_dcu_drm_drv.c | ||
| fsl_dcu_drm_drv.h | ||
| fsl_dcu_drm_kms.c | ||
| fsl_dcu_drm_output.h | ||
| fsl_dcu_drm_plane.c | ||
| fsl_dcu_drm_plane.h | ||
| fsl_dcu_drm_rgb.c | ||
| fsl_tcon.c | ||
| fsl_tcon.h | ||
| Kconfig | ||
| Makefile | ||