Skip to contentSkip to conversation

xtfpga: Fix refcount leak bug in setup

PATCH In review Liang He 2 participants 2 messages Jun 17, 2022 – Jun 18, 2022 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 xtfpga: Fix refcount leak bug in setup

In machine_setup(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
 arch/xtensa/platforms/xtfpga/setup.c | 1 +
 1 file changed, 1 insertion(+)
arch/xtensa/platforms/xtfpga/setup.c +1 -0
index 538e6748e85a..c79c1d09ea86 100644
@@ -133,6 +133,7 @@ static int __init machine_setup(void)
 
 	if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
 		update_local_mac(eth);
+	of_node_put(eth);
 	return 0;
 }
 arch_initcall(machine_setup);
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 9 lines · Liang He

In machine_setup(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
 arch/xtensa/platforms/xtfpga/setup.c | 1 +
 1 file changed, 1 insertion(+)

Thanks. Applied to my xtensa tree.

-- Max