Skip to contentSkip to conversation

powerpc: embedded6xx: Fix refcount leak bug in holly.c

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

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 powerpc: embedded6xx: Fix refcount leak bug in holly.c

In holly_init_pci(), of_find_node_by_type() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
 arch/powerpc/platforms/embedded6xx/holly.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/embedded6xx/holly.c +1 -0
index 78f2378d9223..a4938505e89a 100644
@@ -122,6 +122,7 @@ static void __init holly_init_pci(void)
 	np = of_find_node_by_type(NULL, "pci");
 	if (np)
 		tsi108_setup_pci(np, HOLLY_PCI_CFG_PHYS, 1);
+	of_node_put(np);
 
 	ppc_md.pci_exclude_device = holly_exclude_device;
 	if (ppc_md.progress)
Signature · 1 line
2.25.1