clk: versatile: free icst on error return
authorColin Ian King <colin.king@canonical.com>
Sat, 12 Apr 2014 17:59:14 +0000 (18:59 +0100)
committerMike Turquette <mturquette@linaro.org>
Sat, 31 May 2014 00:07:46 +0000 (17:07 -0700)
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>
drivers/clk/versatile/clk-icst.c

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