Skip to contentSkip to conversation

powerpc/xive: Fix refcount leak in xive_get_max_prio

PATCH Applied Miaoqian Lin 2 participants 2 messages Jun 5, 2022 – Aug 2, 2022 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/xive: Fix refcount leak in xive_get_max_prio

of_find_node_by_path() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak.

Fixes eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller")
---
 arch/powerpc/sysdev/xive/spapr.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/sysdev/xive/spapr.c +1 -0
index 7d5128676e83..d398823d138e 100644
@@ -717,6 +717,7 @@ static bool __init xive_get_max_prio(u8 *max_prio)
 	}
 
 	reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len);
+	of_node_put(rootdn);
 	if (!reg) {
 		pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n");
 		return false;
Signature · 1 line
2.25.1