dlpc_host_attach() registers a MIPI DSI device with
mipi_dsi_device_register_full(). That call adds the device to the DSI
bus and the driver never unregisters it: dlpc3433_remove() only removes
the bridge, and the error path when devm_mipi_dsi_attach() fails returns
without unregistering either. The DSI device is leaked on every
successful probe and on that failure path.

devm_mipi_dsi_attach() only registers a detach action, it does not
unregister the device. Use devm_mipi_dsi_device_register_full() so the
device is unregistered when the bridge device goes away.

Fixes: 6352cd451ddb ("drm: bridge: Add TI DLPC3433 DSI to DMD bridge")
Cc: [email protected]
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <[email protected]>
---
 drivers/gpu/drm/bridge/ti-dlpc3433.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ti-dlpc3433.c 
b/drivers/gpu/drm/bridge/ti-dlpc3433.c
index c9f789e30687..57b160e96059 100644
--- a/drivers/gpu/drm/bridge/ti-dlpc3433.c
+++ b/drivers/gpu/drm/bridge/ti-dlpc3433.c
@@ -325,7 +325,7 @@ static int dlpc_host_attach(struct dlpc *dlpc)
        if (!host)
                return dev_err_probe(dev, -EPROBE_DEFER, "failed to find dsi 
host\n");
 
-       dlpc->dsi = mipi_dsi_device_register_full(host, &info);
+       dlpc->dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
        if (IS_ERR(dlpc->dsi)) {
                DRM_DEV_ERROR(dev, "failed to create dsi device\n");
                return PTR_ERR(dlpc->dsi);
-- 
2.34.1

Reply via email to