ARM: exynos: add missing of_node_put for loop iteration

[ Upstream commit 48d551bf20858240f38a0276be3016ff379918ac ]

Early exits from for_each_compatible_node() should decrement the
node reference counter.  Reported by Coccinelle:

  arch/arm/mach-exynos/exynos.c:52:1-25: WARNING:
    Function "for_each_compatible_node" should have of_node_put() before break around line 58.

Fixes: b3205dea8f ("ARM: EXYNOS: Map SYSRAM through generic DT bindings")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210425174945.164612-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Krzysztof Kozlowski
2021-04-25 19:49:45 +02:00
committed by Greg Kroah-Hartman
parent 85dd41383b
commit 6870bc4267

View File

@@ -55,6 +55,7 @@ void __init exynos_sysram_init(void)
sysram_base_addr = of_iomap(node, 0); sysram_base_addr = of_iomap(node, 0);
sysram_base_phys = of_translate_address(node, sysram_base_phys = of_translate_address(node,
of_get_address(node, 0, NULL, NULL)); of_get_address(node, 0, NULL, NULL));
of_node_put(node);
break; break;
} }
@@ -62,6 +63,7 @@ void __init exynos_sysram_init(void)
if (!of_device_is_available(node)) if (!of_device_is_available(node))
continue; continue;
sysram_ns_base_addr = of_iomap(node, 0); sysram_ns_base_addr = of_iomap(node, 0);
of_node_put(node);
break; break;
} }
} }