Skip to contentSkip to conversation

arm: mach-versatile: Fix refcount leak in v2m

PATCH New Liang He 1 participant 1 message Jun 17, 2022

Subsystems (4)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 arm: mach-versatile: Fix refcount leak in v2m

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

---
 arch/arm/mach-versatile/v2m.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-versatile/v2m.c +1 -0
index 79afdf2a90b6..275f0628aa7e 100644
@@ -17,6 +17,7 @@ void vexpress_flags_set(u32 data)
 				"arm,vexpress-sysreg");
 
 		base = of_iomap(node, 0);
+		of_node_put(node);
 	}
 
 	if (WARN_ON(!base))
Signature · 1 line
2.25.1