powerpc/powermac: fix OF node refcount leak
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 31 Jan 2017 17:43:55 +0000 (09:43 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 4 Dec 2017 00:54:34 +0000 (11:54 +1100)
We need to call of_node_put() for device nodes obtained with
of_find_node_by_name().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powermac/pic.c

index 5e0719b2729488feff62f46ce1b03e6295b090e9..666fceda5e48fe5cbfaa9bf53fb77445b16a95fd 100644 (file)
@@ -604,6 +604,7 @@ static int pmacpic_find_viaint(void)
        if (np == NULL)
                goto not_found;
        viaint = irq_of_parse_and_map(np, 0);
+       of_node_put(np);
 
 not_found:
 #endif /* CONFIG_ADB_PMU */