clk: mmp: clk-of-pxa1928: Free memory obtained by kzalloc
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 20 Sep 2016 09:52:48 +0000 (15:22 +0530)
committerStephen Boyd <sboyd@codeaurora.org>
Fri, 9 Dec 2016 00:29:37 +0000 (16:29 -0800)
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>
drivers/clk/mmp/clk-of-pxa1928.c

index e478ff44e170b4591430064fb9d4eba9592e8dbe..cede7b4ca3b918764fb5cf2f5e7e8a78978f1dd3 100644 (file)
@@ -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;
        }