Skip to contentSkip to conversation

bus: ti-sysc: Add missing of_node_put() in sysc_add_named_clock_from_child()

PATCH In review Peng Wu 2 participants 2 messages Jun 20, 2022 – Jun 28, 2022 OMAP2+ support

lore
Share & tools
lore

Peng Wu

author
#0 lore raw

PATCH 1/1 bus: ti-sysc: Add missing of_node_put() in sysc_add_named_clock_from_child()

of_get_next_available_child() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.

---
 drivers/bus/ti-sysc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/ti-sysc.c +1 -0
index 9a7d12332fad..73fd42dd25b3 100644
@@ -333,6 +333,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata,
 		return -ENODEV;
 
 	clock = devm_get_clk_from_child(ddata->dev, child, name);
+	of_node_put(child);
 	if (IS_ERR(clock))
 		return PTR_ERR(clock);
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 3 lines · Peng Wu

of_get_next_available_child() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.

Thanks applying into omap-for-v5.20/ti-sysc.

Tony