Skip to contentSkip to conversation

powerpc/powernv: Fix refcount leak bug in idle.c

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

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 powerpc/powernv: Fix refcount leak bug in idle.c

In pnv_parse_cpuidle_dt(), of_find_node_by_path() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore.

---
 arch/powerpc/platforms/powernv/idle.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powernv/idle.c +1 -0
index 6f94b808dd39..c1b369c7f507 100644
@@ -1419,6 +1419,7 @@ static int __init pnv_parse_cpuidle_dt(void)
 	kfree(temp_u32);
 	kfree(temp_u64);
 	kfree(temp_string);
+	of_node_put(np);
 	return rc;
 }
 
Signature · 1 line
2.25.1