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>
        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;
        }
 
        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;
        }
 
        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;
        }