MIPS: generic: fix missing of_node_put()

This change “MIPS: generic: fix missing of_node_put()” (commit 28ec223) in Linux kernel is authored by Nicholas Mc Guire <hofrat [at] osadl.org> on Wed Jul 11 20:32:45 2018 +0200.

Description of "MIPS: generic: fix missing of_node_put()"

The change “MIPS: generic: fix missing of_node_put()” introduces changes as follows.

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

Linux kernel releases containing commit 28ec223

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "MIPS: generic: fix missing of_node_put()"

There is one line of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/mips/generic/init.c | 1 +
 1 file changed, 1 insertion(+)
 
diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index 07ec08462d70..a106f8113842 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -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();
 }

The commit for this change in Linux stable tree is 28ec223 (patch).

Last modified: 2020/02/09