[PATCH] arm: mach-versatile: Fix refcount leak in v2m
From: Liang He
Date: Fri Jun 17 2022 - 09:43:00 EST
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.
Signed-off-by: Liang He <windhl@xxxxxxx>
---
arch/arm/mach-versatile/v2m.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-versatile/v2m.c b/arch/arm/mach-versatile/v2m.c
index 79afdf2a90b6..275f0628aa7e 100644
--- a/arch/arm/mach-versatile/v2m.c
+++ b/arch/arm/mach-versatile/v2m.c
@@ -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))
--
2.25.1