Browse Source

clk: versatile: free icst on error return

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@canonical.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Colin Ian King 11 years ago
parent
commit
ab7ad35300
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/clk/versatile/clk-icst.c

+ 1 - 0
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);
 	pclone = kmemdup(desc->params, sizeof(*pclone), GFP_KERNEL);
 	if (!pclone) {
 	if (!pclone) {
+		kfree(icst);
 		pr_err("could not clone ICST params\n");
 		pr_err("could not clone ICST params\n");
 		return ERR_PTR(-ENOMEM);
 		return ERR_PTR(-ENOMEM);
 	}
 	}