Thread (1 message) 1 message, 1 author, 2018-09-02

[PATCH AUTOSEL 4.18 088/131] MIPS: generic: fix missing of_node_put()

flat view
DORMANTno replies

From: Sasha Levin <hidden>
Date: 2018-09-02 13:31:16
Also in: lkml, stable
Subsystem: mips, mips generic platform, the rest · Maintainers: Thomas Bogendoerfer, Paul Burton, Linus Torvalds

From: Nicholas Mc Guire <redacted>

[ Upstream commit 28ec2238f37e72a3a40a7eb46893e7651bcc40a6 ]

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 <redacted>
Signed-off-by: Paul Burton <redacted>
Patchwork: https://patchwork.linux-mips.org/patch/19820/
Cc: Ralf Baechle <redacted>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <redacted>
---
 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 5ba6fcc26fa7..94a78dbbc91f 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -204,6 +204,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();
 }
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help