]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
memory: samsung: exynos-srom: Fix of_iomap leak in exynos_srom_probe
authorZhen Ni <zhen.ni@easystack.cn>
Wed, 6 Aug 2025 02:55:38 +0000 (10:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:37:32 +0000 (16:37 +0200)
commita4df83ad83b60f0768c099d84df4d7def7789ece
tree6573e03ed08e05cbbcdbfcdd3ed81e2f6e104b35
parentb322ea311497f8cdd75c6d6e273d67f044f533d9
memory: samsung: exynos-srom: Fix of_iomap leak in exynos_srom_probe

commit 6744085079e785dae5f7a2239456135407c58b25 upstream.

The of_platform_populate() call at the end of the function has a
possible failure path, causing a resource leak.

Replace of_iomap() with devm_platform_ioremap_resource() to ensure
automatic cleanup of srom->reg_base.

This issue was detected by smatch static analysis:
drivers/memory/samsung/exynos-srom.c:155 exynos_srom_probe()warn:
'srom->reg_base' from of_iomap() not released on lines: 155.

Fixes: 8ac2266d8831 ("memory: samsung: exynos-srom: Add support for bank configuration")
Cc: stable@vger.kernel.org
Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
Link: https://lore.kernel.org/r/20250806025538.306593-1-zhen.ni@easystack.cn
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/memory/samsung/exynos-srom.c