Skip to contentSkip to conversation

powerpc: powernv: opal-core: Fix refcount leak bug

PATCH New Liang He 1 participant 1 message Jun 18, 2022 PowerPC

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 powerpc: powernv: opal-core: Fix refcount leak bug

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

---
 arch/powerpc/platforms/powernv/opal-core.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/powernv/opal-core.c +2 -0
index adcb1a1a2bfe..bb7657115f1d 100644
@@ -348,6 +348,8 @@ static int __init create_opalcore(void)
 	if (!dn || ret)
 		pr_warn("WARNING: Failed to read OPAL base & entry values\n");
 
+	of_node_put(dn);
+
 	/* Use count to keep track of the program headers */
 	count = 0;
 
Signature · 1 line
2.25.1