[PATCH] powerpc : fix resource leak in holly_init_IRQ()

jackysliu 1972843537 at qq.com
Mon Jul 21 14:17:32 AEST 2025


From: Siyang Liu <1972843537 at qq.com>

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.

Signed-off-by: Siyang Liu <1972843537 at qq.com>
---
 arch/powerpc/platforms/embedded6xx/holly.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index ce9e58ee9754..fefb7fd2365f 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -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;
 	}
 
-- 
2.43.5



More information about the Linuxppc-dev mailing list