[PATCH] drm/panel: Fix node reference leak in rpi_touchscreen_probe()

From: Wentao Liang

Date: Wed Sep 16 2026 - 15:09:19 EST


of_graph_get_remote_port() returns a reference to the remote port
node. On the success path that reference is passed to the registered
DSI device and released with it, but if mipi_dsi_device_register_full()
fails the reference is never dropped. Release it on the error path.

Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index dc4bb8ad9131..c14776561623 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -428,6 +428,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
if (IS_ERR(ts->dsi)) {
dev_err(dev, "DSI device registration failed: %ld\n",
PTR_ERR(ts->dsi));
+ of_node_put(info.node);
return PTR_ERR(ts->dsi);
}

--
2.34.1