powerpc/via-pmu: fix OF node leak in Keylargo init
authorPhil Carmody <pc+lkml@asdf.org>
Tue, 16 Sep 2014 22:00:54 +0000 (01:00 +0300)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 17 Mar 2015 00:56:51 +0000 (11:56 +1100)
If we of_find_node_by_name() then we must of_node_put() too.

Signed-off-by: Phil Carmody <pc+lkml@asdf.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/macintosh/via-pmu.c

index 62212358640d31f8a24c90a9b66015aae9526100..aed3cb07a6fa88eb96c65dce6475cb0bf8b53c73 100644 (file)
@@ -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");