Re: [PATCH] clk: versatile: free icst on error return
From: Mike Turquette
Date: Fri May 30 2014 - 20:08:40 EST
Quoting Colin King (2014-04-12 10:59:14)
> 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>
Applied to clk-next.
Thanks,
Mike
> ---
> 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/