[PATCH] clk: versatile: free icst on error return

From: Colin King
Date: Sat Apr 12 2014 - 13:59:30 EST


From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

commit a183da63 introduced a new error return path that does
not kfree icst if the kmemdup of desc->params fails.

Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
---
drivers/clk/versatile/clk-icst.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index a820b0c..eb3a1e4 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -140,6 +140,7 @@ struct clk *icst_clk_register(struct device *dev,

pclone = kmemdup(desc->params, sizeof(*pclone), GFP_KERNEL);
if (!pclone) {
+ kfree(icst);
pr_err("could not clone ICST params\n");
return ERR_PTR(-ENOMEM);
}
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/