linux/drivers/soc/samsung
Weigang He fa476d53ed soc: samsung: exynos-pmu: fix of_node refcount leak in exynos_get_pmu_regmap()
exynos_get_pmu_regmap() obtains a device_node via of_find_matching_node()
and passes it to exynos_get_pmu_regmap_by_phandle(np, NULL). With
propname == NULL the callee uses np directly and does not drop a
reference, so the reference taken by of_find_matching_node() is leaked on
every call -- including on each -EPROBE_DEFER retry of the only in-tree
caller, exynos_retention_init() in the Exynos pinctrl driver.

Annotate np with the __free(device_node) cleanup attribute so the
reference is released when the function returns.

Found by static analysis tool CodeQL.

Fixes: 76640b84bd ("soc: samsung: pmu: Provide global function to get PMU regmap")
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Link: https://patch.msgid.link/20260609143852.1783558-1-geoffreyhe2@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-06-29 11:58:33 +02:00
..
exynos-asv.c soc: samsung: include linux/array_size.h where needed 2025-03-06 19:10:17 +01:00
exynos-asv.h soc: samsung: exynos-chipid: convert to driver and merge exynos-asv 2021-01-03 17:08:45 +01:00
exynos-chipid.c soc: samsung: exynos-chipid: add google,gs101-otp support 2025-12-28 12:31:38 +01:00
exynos-pmu.c soc: samsung: exynos-pmu: fix of_node refcount leak in exynos_get_pmu_regmap() 2026-06-29 11:58:33 +02:00
exynos-pmu.h soc: samsung: exynos-pmu: move some gs101 related code into new file 2025-10-18 19:16:44 +02:00
exynos-regulator-coupler.c
exynos-usi.c soc: samsung: usi: prevent wrong bits inversion during unconfiguring 2025-04-14 08:51:18 +02:00
exynos4-pmu.c soc: samsung: exynos-pmu: Re-introduce Exynos4212 support 2023-05-09 19:49:37 +02:00
exynos3250-pmu.c soc: samsung: include linux/array_size.h where needed 2025-03-06 19:10:17 +01:00
exynos5250-pmu.c soc: samsung: include linux/array_size.h where needed 2025-03-06 19:10:17 +01:00
exynos5420-pmu.c soc: samsung: include linux/array_size.h where needed 2025-03-06 19:10:17 +01:00
exynos5422-asv.c soc: samsung: exynos-chipid: convert to a module 2021-09-29 15:50:34 +02:00
exynos5422-asv.h
gs101-pmu.c soc: samsung: gs101-pmu: implement access tables for read and write 2025-10-18 19:16:45 +02:00
Kconfig soc: samsung: exynos-pmu: Add regmap support for SoCs that protect PMU regs 2024-02-25 11:39:23 +01:00
Makefile soc: samsung: exynos-pmu: move some gs101 related code into new file 2025-10-18 19:16:44 +02:00
s3c-pm-check.c soc: samsung: s3c-pm-check: Fix incorrectly named variable 'val' 2020-11-03 21:37:45 +01:00