[PATCH] ARM: actions: add missing of_node_put calls

From: Martin Kaiser
Date: Sun Dec 18 2022 - 08:01:06 EST


A node that is returned by of_find_compatible_node has its refcount
incremented. We have to call of_node_put when the node is no longer
needed.

Add the missing of_node_put calls in function s500_smp_prepare_cpus.

Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
---
compile-tested only, I don't have this hardware

arch/arm/mach-actions/platsmp.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index f26618b43514..9fe9a0bd0fd0 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -103,6 +103,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
}

timer_base_addr = of_iomap(node, 0);
+ of_node_put(node);
if (!timer_base_addr) {
pr_err("%s: could not map timer registers\n", __func__);
return;
@@ -115,6 +116,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
}

sps_base_addr = of_iomap(node, 0);
+ of_node_put(node);
if (!sps_base_addr) {
pr_err("%s: could not map sps registers\n", __func__);
return;
@@ -128,6 +130,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
}

scu_base_addr = of_iomap(node, 0);
+ of_node_put(node);
if (!scu_base_addr) {
pr_err("%s: could not map scu registers\n", __func__);
return;
--
2.30.2