[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130115010410.23734.88154@quantum>
Date: Mon, 14 Jan 2013 17:04:10 -0800
From: Mike Turquette <mturquette@...aro.org>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Cc: Jonghwa Lee <jonghwa3.lee@...sung.com>
Subject: Re: [PATCH] clk: max77686: Avoid double free at remove time
Quoting Laurent Pinchart (2013-01-06 17:05:19)
> The clk_lookup entry is dropped at remove time by a call to
> clkdev_drop(). That function frees the entry, which is also freed by the
> driver core as it has been allocated through devm_kzalloc(). This
> results in a double free.
>
> Use kzalloc() instead of devm_kzalloc() to fix this.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Hi Laurent,
Thanks for the fix. Applied to clk-next.
Regards,
Mike
> ---
> drivers/clk/clk-max77686.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
> index d098f72..6de05c5 100644
> --- a/drivers/clk/clk-max77686.c
> +++ b/drivers/clk/clk-max77686.c
> @@ -130,8 +130,7 @@ static int max77686_clk_register(struct device *dev,
> if (IS_ERR(clk))
> return -ENOMEM;
>
> - max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup),
> - GFP_KERNEL);
> + max77686->lookup = kzalloc(sizeof(struct clk_lookup), GFP_KERNEL);
> if (IS_ERR(max77686->lookup))
> return -ENOMEM;
>
> --
> Regards,
>
> Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists