summaryrefslogtreecommitdiff
path: root/drivers/clk/mmp/clk-of-pxa1928.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2016-09-20 12:52:48 +0300
committerStephen Boyd <sboyd@codeaurora.org>2016-12-09 03:29:37 +0300
commit8daa528204de0d8f085013a3ea1d8af755636885 (patch)
tree5fc91bf01cabd0f6d482a60ed383d40ebe3eee20 /drivers/clk/mmp/clk-of-pxa1928.c
parent5785271ef2bb9ca37ba1b40ec56b8d127caf3b2c (diff)
downloadlinux-8daa528204de0d8f085013a3ea1d8af755636885.tar.xz
clk: mmp: clk-of-pxa1928: Free memory obtained by kzalloc
Free memory, if init is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/mmp/clk-of-pxa1928.c')
-rw-r--r--drivers/clk/mmp/clk-of-pxa1928.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/clk/mmp/clk-of-pxa1928.c b/drivers/clk/mmp/clk-of-pxa1928.c
index e478ff44e170..cede7b4ca3b9 100644
--- a/drivers/clk/mmp/clk-of-pxa1928.c
+++ b/drivers/clk/mmp/clk-of-pxa1928.c
@@ -216,6 +216,7 @@ static void __init pxa1928_mpmu_clk_init(struct device_node *np)
pxa_unit->mpmu_base = of_iomap(np, 0);
if (!pxa_unit->mpmu_base) {
pr_err("failed to map mpmu registers\n");
+ kfree(pxa_unit);
return;
}
@@ -234,6 +235,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np)
pxa_unit->apmu_base = of_iomap(np, 0);
if (!pxa_unit->apmu_base) {
pr_err("failed to map apmu registers\n");
+ kfree(pxa_unit);
return;
}
@@ -254,6 +256,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np)
pxa_unit->apbc_base = of_iomap(np, 0);
if (!pxa_unit->apbc_base) {
pr_err("failed to map apbc registers\n");
+ kfree(pxa_unit);
return;
}