[PATCH v3 2/2] arm: topology: add missing of_node_put() for cpu device node

From: Dietmar Eggemann
Date: Tue Oct 24 2017 - 06:27:38 EST


This patch adds the missing of_node_put() for of_find_node_by_path() and
of_get_cpu_node() in parse_dt_topology().

Cc: Russell King <linux@xxxxxxxxxxxxxxxx>
Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
Cc: Juri Lelli <juri.lelli@xxxxxxxxx>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
---
arch/arm/kernel/topology.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 15cc131ae387..81ec42333489 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -41,6 +41,7 @@ static void __init parse_dt_topology(void)
pr_err("No CPU information found in DT\n");
return;
}
+ of_node_put(cn);

for_each_possible_cpu(cpu) {
/* too early to use cpu->of_node */
@@ -50,8 +51,8 @@ static void __init parse_dt_topology(void)
continue;
}

- if (topology_parse_cpu_capacity(cn, cpu))
- of_node_put(cn);
+ topology_parse_cpu_capacity(cn, cpu);
+ of_node_put(cn);
}

topology_normalize_cpu_scale();
--
2.11.0