DORMANTno replies

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

From: Liang He <hidden>
Date: 2022-06-20 06:39:52
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

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.

Signed-off-by: Liang He <redacted>
---
 arch/powerpc/platforms/powernv/idle.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
index 6f94b808dd39..c1b369c7f507 100644
--- a/arch/powerpc/platforms/powernv/idle.c
+++ b/arch/powerpc/platforms/powernv/idle.c
@@ -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;
 }
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help