[PATCH 2/2] powerpc/via-pmu: fix OF node leak in Keylargo init

Aaro Koskinen aaro.koskinen at iki.fi
Wed Sep 17 08:00:54 EST 2014


From: Phil Carmody <pc+lkml at asdf.org>

If we of_find_node_by_name() then we must of_node_put() too.

Signed-off-by: Phil Carmody <pc+lkml at asdf.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen at iki.fi>
---
 drivers/macintosh/via-pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 6221235..aed3cb0 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -329,6 +329,7 @@ int __init find_via_pmu(void)
 				gaddr = of_translate_address(gpiop, reg);
 			if (gaddr != OF_BAD_ADDR)
 				gpio_reg = ioremap(gaddr, 0x10);
+			of_node_put(gpiop);
 		}
 		if (gpio_reg == NULL) {
 			printk(KERN_ERR "via-pmu: Can't find GPIO reg !\n");
-- 
2.1.0



More information about the Linuxppc-dev mailing list