]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ARM: exynos: add missing of_node_put for loop iteration
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Sun, 25 Apr 2021 17:49:45 +0000 (19:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:10:51 +0000 (16:10 +0200)
[ 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: b3205dea8fbf ("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>
arch/arm/mach-exynos/exynos.c

index 9aa483366ebcbcde3597fe5e2a9911d2840508a4..f226d4f57bf41800a987314c841d6b09a1d4a471 100644 (file)
@@ -46,6 +46,7 @@ void __init exynos_sysram_init(void)
                sysram_base_addr = of_iomap(node, 0);
                sysram_base_phys = of_translate_address(node,
                                           of_get_address(node, 0, NULL, NULL));
+               of_node_put(node);
                break;
        }
 
@@ -53,6 +54,7 @@ void __init exynos_sysram_init(void)
                if (!of_device_is_available(node))
                        continue;
                sysram_ns_base_addr = of_iomap(node, 0);
+               of_node_put(node);
                break;
        }
 }