[PATCH] drm/rockchip: dsi: Fix second reference leak in dw_mipi_dsi_rockchip_host_attach()
Wentao Liang
vulab at iscas.ac.cn
Wed Sep 16 11:13:10 PDT 2026
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 at vger.kernel.org
Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
---
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
More information about the linux-arm-kernel
mailing list