Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27bbd23f authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Krzysztof Kozlowski
Browse files

ARM: EXYNOS: Fix potentian kfree() of ro memory



The change fixes a bug introduced by 2be2a3ff, memory allocated
by kstrdup_const() must be always deallocated with kfree_const(),
otherwise there is a risk of kfree'ing ro memory in power domain error
exit path.

Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Cc: <stable@vger.kernel.org>
Fixes: 2be2a3ff ("ARM: EXYNOS: register power domain driver from core_initcall")
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
parent d770e558
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ static __init int exynos4_pm_init_power_domain(void)
		pd->base = of_iomap(np, 0);
		if (!pd->base) {
			pr_warn("%s: failed to map memory\n", __func__);
			kfree(pd->pd.name);
			kfree_const(pd->pd.name);
			kfree(pd);
			of_node_put(np);
			continue;