Commit 8daa5282 authored by Arvind Yadav's avatar Arvind Yadav Committed by Stephen Boyd

clk: mmp: clk-of-pxa1928: Free memory obtained by kzalloc

Free memory, if init is not successful.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 5785271e
...@@ -216,6 +216,7 @@ static void __init pxa1928_mpmu_clk_init(struct device_node *np) ...@@ -216,6 +216,7 @@ static void __init pxa1928_mpmu_clk_init(struct device_node *np)
pxa_unit->mpmu_base = of_iomap(np, 0); pxa_unit->mpmu_base = of_iomap(np, 0);
if (!pxa_unit->mpmu_base) { if (!pxa_unit->mpmu_base) {
pr_err("failed to map mpmu registers\n"); pr_err("failed to map mpmu registers\n");
kfree(pxa_unit);
return; return;
} }
...@@ -234,6 +235,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np) ...@@ -234,6 +235,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np)
pxa_unit->apmu_base = of_iomap(np, 0); pxa_unit->apmu_base = of_iomap(np, 0);
if (!pxa_unit->apmu_base) { if (!pxa_unit->apmu_base) {
pr_err("failed to map apmu registers\n"); pr_err("failed to map apmu registers\n");
kfree(pxa_unit);
return; return;
} }
...@@ -254,6 +256,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np) ...@@ -254,6 +256,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np)
pxa_unit->apbc_base = of_iomap(np, 0); pxa_unit->apbc_base = of_iomap(np, 0);
if (!pxa_unit->apbc_base) { if (!pxa_unit->apbc_base) {
pr_err("failed to map apbc registers\n"); pr_err("failed to map apbc registers\n");
kfree(pxa_unit);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment