Skip to contentSkip to conversation

arch: mips: generic: Add missing of_node_put() in board-ranchu.c

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

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 arch: mips: generic: Add missing of_node_put() in board-ranchu.c

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

---
 arch/mips/generic/board-ranchu.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/generic/board-ranchu.c +1 -0
index a89aaad59cb1..930c45041882 100644
@@ -44,6 +44,7 @@ static __init unsigned int ranchu_measure_hpt_freq(void)
 		      __func__);
 
 	rtc_base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!rtc_base)
 		panic("%s(): Failed to ioremap Goldfish RTC base!", __func__);
 
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 23 lines · Liang He

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

---
 arch/mips/generic/board-ranchu.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/generic/board-ranchu.c +1 -0
index a89aaad59cb1..930c45041882 100644
@@ -44,6 +44,7 @@ static __init unsigned int ranchu_measure_hpt_freq(void)
 		      __func__);
 
 	rtc_base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!rtc_base)
 		panic("%s(): Failed to ioremap Goldfish RTC base!", __func__);
 
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 ]