dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/of: Fix device node reference leak in drm_of_panel_bridge_remove
@ 2025-10-28  6:09 Miaoqian Lin
  2025-10-28 14:00 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Miaoqian Lin @ 2025-10-28  6:09 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, benjamin.gaignard@linaro.org, Philippe Cornu,
	dri-devel, linux-kernel
  Cc: linmq006, stable

of_graph_get_remote_node() returns a device node
with its reference count incremented. The caller is responsible for
releasing this reference when the node is no longer needed.

Add of_node_put(remote) to fix the reference leak.

Found via static analysis.

Fixes: c70087e8f16f ("drm/drm_of: add drm_of_panel_bridge_remove function")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 include/drm/drm_of.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h
index 7f0256dae3f1..5940b1cd542b 100644
--- a/include/drm/drm_of.h
+++ b/include/drm/drm_of.h
@@ -171,6 +171,7 @@ static inline int drm_of_panel_bridge_remove(const struct device_node *np,
 		return -ENODEV;
 
 	bridge = of_drm_find_bridge(remote);
+	of_node_put(remote);
 	drm_panel_bridge_remove(bridge);
 
 	return 0;
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-28 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28  6:09 [PATCH] drm/of: Fix device node reference leak in drm_of_panel_bridge_remove Miaoqian Lin
2025-10-28 14:00 ` kernel test robot
2025-10-28 14:22 ` kernel test robot
2025-10-28 14:32 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).