Skip to contentSkip to conversation

bus: ti-sysc: fix reference count leak in sysc_init_static_data()

PATCH In review Weigang He 2 participants 2 messages Jan 17 – Jan 22

Subsystems (2)
lore
Share & tools
lore

Weigang He

author
#0 lore raw

PATCH 1/1 bus: ti-sysc: fix reference count leak in sysc_init_static_data()

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")
---
 drivers/bus/ti-sysc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/ti-sysc.c +1 -0
index 610354ce7f8f0..fd631a9889c1e 100644
@@ -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;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Sat, 17 Jan 2026 06:22:35 +0000 Weigang He <[email protected]> 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")