[PATCH] powerpc/powermac: Fix refcount leak bug

Liang He windhl at 126.com
Tue Jun 21 01:05:18 AEST 2022


In smp_core99_setup(), we need to add of_node_put() to keep refcount
balance.

Signed-off-by: Liang He <windhl at 126.com>
---
 arch/powerpc/platforms/powermac/smp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index d9df45741ece..5b26a9012d2e 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -711,6 +711,7 @@ static void __init smp_core99_setup(int ncpus)
 			printk(KERN_INFO "Processor timebase sync using"
 			       " platform function\n");
 		}
+		of_node_put(cpus);
 	}
 
 #else /* CONFIG_PPC64 */
-- 
2.25.1



More information about the Linuxppc-dev mailing list