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 <[email protected]>
Cc: Vincent Guittot <[email protected]>
Cc: Juri Lelli <[email protected]>
Signed-off-by: Dietmar Eggemann <[email protected]>
---
 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

Reply via email to