* [PATCH] bus: ti-sysc: fix reference count leak in sysc_init_stdout_path()
@ 2026-01-17 5:54 Weigang He
0 siblings, 0 replies; only message in thread
From: Weigang He @ 2026-01-17 5:54 UTC (permalink / raw)
To: tony, aaro.koskinen, andreas, khilman, rogerq
Cc: linux-omap, linux-kernel, Weigang He, stable
of_find_node_by_path() returns a device_node with refcount incremented.
When of_get_property() is called to get the stdout-path property, the
reference to the "/chosen" node stored in np is either leaked if the
property lookup fails, or overwritten when np is reassigned to the uart
node path without releasing the "/chosen" reference first.
Add of_node_put(np) after of_get_property() to properly release the
"/chosen" node reference before either going to the error path or
acquiring a new reference for the uart path.
Fixes: 3bb37c8e6e6a ("bus: ti-sysc: Handle stdout-path for debug console")
Cc: stable@vger.kernel.org
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
---
drivers/bus/ti-sysc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 610354ce7f8f0..091cdad2f2cc6 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -696,6 +696,7 @@ static void sysc_init_stdout_path(struct sysc *ddata)
goto err;
uart = of_get_property(np, "stdout-path", NULL);
+ of_node_put(np);
if (!uart)
goto err;
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-17 5:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-17 5:54 [PATCH] bus: ti-sysc: fix reference count leak in sysc_init_stdout_path() Weigang He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®