* [PATCH] bus: ti-sysc: fix reference count leak in sysc_init_static_data()
@ 2026-01-17 6:22 Weigang He
2026-01-22 8:35 ` Andreas Kemnade
0 siblings, 1 reply; 2+ messages in thread
From: Weigang He @ 2026-01-17 6:22 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.
The reference to the "/ocp" node is acquired for a WARN_ONCE check but
is never released with of_node_put(), causing a reference count leak.
Add of_node_put(np) after the WARN_ONCE check to properly release the
"/ocp" node reference.
Fixes: 5f7259a578e9 ("bus: ti-sysc: Check for old incomplete dtb")
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..fd631a9889c1e 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -3014,6 +3014,7 @@ static int sysc_init_static_data(struct sysc *ddata)
np = of_find_node_by_path("/ocp");
WARN_ONCE(np && of_device_is_compatible(np, "simple-bus"),
"ti-sysc: Incomplete old dtb, please update\n");
+ of_node_put(np);
break;
default:
break;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] bus: ti-sysc: fix reference count leak in sysc_init_static_data()
2026-01-17 6:22 [PATCH] bus: ti-sysc: fix reference count leak in sysc_init_static_data() Weigang He
@ 2026-01-22 8:35 ` Andreas Kemnade
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Kemnade @ 2026-01-22 8:35 UTC (permalink / raw)
To: Weigang He
Cc: tony, aaro.koskinen, khilman, rogerq, linux-omap, linux-kernel,
stable
On Sat, 17 Jan 2026 06:22:35 +0000
Weigang He <geoffreyhe2@gmail.com> wrote:
> of_find_node_by_path() returns a device_node with refcount incremented.
> The reference to the "/ocp" node is acquired for a WARN_ONCE check but
> is never released with of_node_put(), causing a reference count leak.
>
> Add of_node_put(np) after the WARN_ONCE check to properly release the
> "/ocp" node reference.
>
> Fixes: 5f7259a578e9 ("bus: ti-sysc: Check for old incomplete dtb")
> Cc: stable@vger.kernel.org
> Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-22 8:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-17 6:22 [PATCH] bus: ti-sysc: fix reference count leak in sysc_init_static_data() Weigang He
2026-01-22 8:35 ` Andreas Kemnade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox