[PATCH] drm/kmb: fix bridge reference leak on probe error and remove
From: Haotian Zhang
Date: Thu Oct 08 2026 - 23:35:53 EST
kmb_dsi_host_bridge_init() looks up the ADV7535 bridge with
of_drm_find_and_get_bridge(), which takes a reference on the bridge, and
stores it in the global adv_bridge. That reference is never released, so
unbinding the driver leaves the bridge refcount permanently elevated and
prevents the bridge driver from ever being removed. The same happens
when probe fails after the bridge has been found.
Release the reference in kmb_dsi_host_unregister(), which is called both
from the probe error path and from kmb_remove().
Fixes: abbe7f8144d5 ("drm/kmb/dsi: convert to of_drm_find_and_get_bridge()")
Assisted-by: DeepSeek-V4.1-Flash
Signed-off-by: Haotian Zhang <vulab@xxxxxxxxxxx>
---
drivers/gpu/drm/kmb/kmb_dsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
index 59d0e856392f..483f4afe6317 100644
--- a/drivers/gpu/drm/kmb/kmb_dsi.c
+++ b/drivers/gpu/drm/kmb/kmb_dsi.c
@@ -184,6 +184,10 @@ void kmb_dsi_host_unregister(struct kmb_dsi *kmb_dsi)
{
kmb_dsi_clk_disable(kmb_dsi);
mipi_dsi_host_unregister(kmb_dsi->host);
+
+ /* Release the bridge reference taken in kmb_dsi_host_bridge_init() */
+ drm_bridge_put(adv_bridge);
+ adv_bridge = NULL;
}
/*
--
2.25.1