]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
MIPS: generic: fix missing of_node_put()
authorNicholas Mc Guire <hofrat@osadl.org>
Wed, 11 Jul 2018 18:32:45 +0000 (20:32 +0200)
committerPaul Burton <paul.burton@mips.com>
Sat, 28 Jul 2018 02:48:57 +0000 (19:48 -0700)
of_find_compatible_node() returns a device_node pointer with refcount
incremented and must be decremented explicitly.
 As this code is using the result only to check presence of the interrupt
controller (!NULL) but not actually using the result otherwise the
refcount can be decremented here immediately again.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/19820/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
arch/mips/generic/init.c

index 07ec08462d70f11f0af06801d6f22362f34a885b..a106f8113842a35e4c125d741a11992b63d95281 100644 (file)
@@ -203,6 +203,7 @@ void __init arch_init_irq(void)
                                            "mti,cpu-interrupt-controller");
        if (!cpu_has_veic && !intc_node)
                mips_cpu_irq_init();
+       of_node_put(intc_node);
 
        irqchip_init();
 }