Message ID | 22084283-6854-41f9-b45a-4b27ce207f76@web.de (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | versatile clock: Adjustments for two function implementations | expand |
diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c index c4cf50a48972..9957dc9b8941 100644 --- a/drivers/clk/versatile/clk-icst.c +++ b/drivers/clk/versatile/clk-icst.c @@ -351,8 +351,8 @@ struct clk *icst_clk_setup(struct device *dev, pclone = kmemdup(desc->params, sizeof(*pclone), GFP_KERNEL); if (!pclone) { - kfree(icst); - return ERR_PTR(-ENOMEM); + clk = ERR_PTR(-ENOMEM); + goto free_icst; } init.name = name; @@ -370,6 +370,7 @@ struct clk *icst_clk_setup(struct device *dev, clk = clk_register(dev, &icst->hw); if (IS_ERR(clk)) { kfree(pclone); +free_icst: kfree(icst); }