[PATCH] powerpc/pasemi: Fix refcount leak bug

Liang He windhl at 126.com
Tue Jun 21 01:12:02 AEST 2022


In pas_pci_init(), we need one of_node_put() for of_find_node_by_path()
to keep refcount balance.

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

diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index 55f0160910bf..4b371fb0d9aa 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -282,6 +282,7 @@ void __init pas_pci_init(void)
 	pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);
 
 	np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
+	of_node_put(root);
 	if (np) {
 		res = pas_add_bridge(np);
 		of_node_put(np);
-- 
2.25.1



More information about the Linuxppc-dev mailing list