LKML Archive on
 help / Atom feed
* [PATCH] MIPS: generic: fix missing of_node_put()
@ 2018-07-11 18:32 Nicholas Mc Guire
  0 siblings, 0 replies; 1+ messages in thread
From: Nicholas Mc Guire @ 2018-07-11 18:32 UTC (permalink / raw)
  To: Paul Burton
  Cc: Ralf Baechle, James Hogan, linux-mips, linux-kernel, Nicholas Mc Guire

 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 <>
Fixes: commit eed0eabd12ef ("MIPS: generic: Introduce generic DT-based board support")

Problem located with an experimental coccinelle script

Patch was compiletested with: 32r1_defconfig (implies generic_defconfig)

Patch is against 4.18-rc4 (localversion-next is next-20180711)

 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 07ec084..a106f81 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -203,6 +203,7 @@ void __init arch_init_irq(void)
 	if (!cpu_has_veic && !intc_node)
+	of_node_put(intc_node);

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 18:32 [PATCH] MIPS: generic: fix missing of_node_put() Nicholas Mc Guire

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox