[PATCH] drm/rockchip: dsi: Fix second reference leak in dw_mipi_dsi_rockchip_host_attach()
From: Wentao Liang
Date: Wed Sep 16 2026 - 14:14:01 EST
The reference to the dual-DSI partner device obtained through
dw_mipi_dsi_rockchip_find_second() is dropped on neither the success
path nor when adding the partner as a component fails. Release it on
both paths.
Fixes: cf6d100dd238 ("drm/rockchip: dsi: add dual mipi support")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 4ab29410b2c0..2c1f1c53ddda 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -1079,8 +1079,10 @@ static int dw_mipi_dsi_rockchip_host_attach(void *priv_data,
DRM_DEV_ERROR(second,
"Failed to register component: %d\n",
ret);
+ put_device(second);
goto out;
}
+ put_device(second);
}
return 0;
--
2.34.1