Skip to content

Commit

Permalink
ARM: EXYNOS: Fix potentian kfree() of ro memory
Browse files Browse the repository at this point in the history
The change fixes a bug introduced by 2be2a3f, 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: Vladimir Zapolskiy <vz@mleia.com>
Cc: <stable@vger.kernel.org>
Fixes: 2be2a3f ("ARM: EXYNOS: register power domain driver from core_initcall")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
  • Loading branch information
Vladimir Zapolskiy authored and Krzysztof Kozlowski committed Jul 31, 2015
1 parent d770e55 commit 27bbd23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-exynos/pm_domains.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27bbd23

Please sign in to comment.