Skip to contentSkip to conversation

mips: lantiq: Add missing of_node_put() in irq.c

PATCH Applied Liang He 2 participants 2 messages Jun 21, 2022 – Jun 22, 2022

Subsystems (2)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH v2 1/1 mips: lantiq: Add missing of_node_put() in irq.c

In icu_of_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
changelog:

v2: fix bug intro-ed by v1, only one put needed.
v1: add missing of_node_put()

 arch/mips/lantiq/irq.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/lantiq/irq.c +1 -0
index b732495f138a..20622bf0a9b3 100644
@@ -408,6 +408,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
 		if (!ltq_eiu_membase)
 			panic("Failed to remap eiu memory");
 	}
+	of_node_put(eiu_node);
 
 	return 0;
 }
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 28 lines · Liang He

In icu_of_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
changelog:

v2: fix bug intro-ed by v1, only one put needed.
v1: add missing of_node_put()

 arch/mips/lantiq/irq.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/lantiq/irq.c +1 -0
index b732495f138a..20622bf0a9b3 100644
@@ -408,6 +408,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
 		if (!ltq_eiu_membase)
 			panic("Failed to remap eiu memory");
 	}
+	of_node_put(eiu_node);
 
 	return 0;
 }
Signature · 1 line
2.25.1

applied to mips-fixes.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]