imx8qxp_pxl2dpi_parse_dt_companion() takes a reference on the companion
bridge with of_drm_find_and_get_bridge() and stores it in p2d->companion.
That reference is dropped by the bridge destroy callback, which bails out
early because p2d->bridge.driver_private is only assigned at the very end
of the probe.  When the dual-link pixel order detection fails, the probe
returns an error and the reference, and with it the companion bridge, is
never released.

Release the companion bridge on that error path before returning.

Fixes: 900699ba830f ("drm/bridge: imx8qxp-pxl2dpi: get/put the companion 
bridge")
Cc: [email protected]
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <[email protected]>
---
 drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c 
b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
index dce1a5b36024..e0d06a968724 100644
--- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c
@@ -374,6 +374,7 @@ static int imx8qxp_pxl2dpi_parse_dt_companion(struct 
imx8qxp_pxl2dpi *p2d)
                ret = dual_link;
                DRM_DEV_ERROR(dev, "failed to get dual link pixel order: %d\n",
                              ret);
+               drm_bridge_clear_and_put(&p2d->companion);
                goto out;
        }
 
-- 
2.34.1

Reply via email to