All of lore.kernel.org
 help / color / mirror / Atom feed
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: max77686: Avoid double free at remove time
Date: Mon, 14 Jan 2013 17:04:10 -0800	[thread overview]
Message-ID: <20130115010410.23734.88154@quantum> (raw)
In-Reply-To: <1357520719-3782-1-git-send-email-laurent.pinchart@ideasonboard.com>

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@ideasonboard.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

WARNING: multiple messages have this Message-ID (diff)
From: Mike Turquette <mturquette@linaro.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Jonghwa Lee <jonghwa3.lee@samsung.com>
Subject: Re: [PATCH] clk: max77686: Avoid double free at remove time
Date: Mon, 14 Jan 2013 17:04:10 -0800	[thread overview]
Message-ID: <20130115010410.23734.88154@quantum> (raw)
In-Reply-To: <1357520719-3782-1-git-send-email-laurent.pinchart@ideasonboard.com>

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@ideasonboard.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

  reply	other threads:[~2013-01-15  1:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07  1:05 [PATCH] clk: max77686: Avoid double free at remove time Laurent Pinchart
2013-01-07  1:05 ` Laurent Pinchart
2013-01-15  1:04 ` Mike Turquette [this message]
2013-01-15  1:04   ` Mike Turquette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130115010410.23734.88154@quantum \
    --to=mturquette@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.