Skip to contentSkip to conversation

powerpc : fix resource leak in holly_init_IRQ()

PATCH New jackysliu 1 participant 1 message Jul 21, 2025 PowerPC

lore
Share & tools
lore

jackysliu

author
#0 lore raw

PATCH 1/1 powerpc : fix resource leak in holly_init_IRQ()

From: Siyang Liu <[email protected]>

When the 'pic-router' device node lookup fails in holly_init_IRQ(), the function returns without releasing the previously acquired 'tsi_pci' node. This violates the device tree reference counting rules and causes a resource leak.

This issue was detected by rule based static tools developed by Tencent.

---
 arch/powerpc/platforms/embedded6xx/holly.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/embedded6xx/holly.c +1 -0
index ce9e58ee9754..fefb7fd2365f 100644
@@ -178,6 +178,7 @@ static void __init holly_init_IRQ(void)
 	cascade_node = of_find_node_by_type(NULL, "pic-router");
 	if (cascade_node == NULL) {
 		printk(KERN_ERR "%s: No tsi108 pci cascade node found !\n", __func__);
+		of_node_put(tsi_pci);
 		return;
 	}
 
Signature · 1 line
2.43.5