powerpc : fix resource leak in holly_init_IRQ()
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.
Signed-off-by Siyang Liu <[email protected]>
--- arch/powerpc/platforms/embedded6xx/holly.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/embedded6xx/holly.c +1 -0
@@ -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