Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: generic: fix missing of_node_put()

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

authored by

Nicholas Mc Guire and committed by
Paul Burton
28ec2238 b1259519

+1
+1
arch/mips/generic/init.c
··· 203 203 "mti,cpu-interrupt-controller"); 204 204 if (!cpu_has_veic && !intc_node) 205 205 mips_cpu_irq_init(); 206 + of_node_put(intc_node); 206 207 207 208 irqchip_init(); 208 209 }