public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] leds: pca9532: free after input_unregister_device()
Date: Fri, 12 Nov 2010 05:21:37 +0000	[thread overview]
Message-ID: <20101112052137.GA10871@core.coreip.homeip.net> (raw)
In-Reply-To: <20101112043018.GB3644@bicker>

On Fri, Nov 12, 2010 at 07:30:18AM +0300, Dan Carpenter wrote:
> input_unregister_device() frees data->idev so the second
> input_free_device() is a double free.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Dmitry Torokhov <dtor@mail.ru>

> 
> diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
> index 43d0875..e1700cd 100644
> --- a/drivers/leds/leds-pca9532.c
> +++ b/drivers/leds/leds-pca9532.c
> @@ -286,7 +286,6 @@ exit:
>  			case PCA9532_TYPE_N2100_BEEP:
>  				if (data->idev != NULL) {
>  					input_unregister_device(data->idev);
> -					input_free_device(data->idev);
>  					cancel_work_sync(&data->work);
>  					data->idev = NULL;
>  				}
> @@ -341,7 +340,6 @@ static int pca9532_remove(struct i2c_client *client)
>  		case PCA9532_TYPE_N2100_BEEP:
>  			if (data->idev != NULL) {
>  				input_unregister_device(data->idev);
> -				input_free_device(data->idev);
>  				cancel_work_sync(&data->work);
>  				data->idev = NULL;
>  			}

-- 
Dmitry

      reply	other threads:[~2010-11-12  5:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12  4:30 [patch] leds: pca9532: free after input_unregister_device() Dan Carpenter
2010-11-12  5:21 ` Dmitry Torokhov [this message]

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=20101112052137.GA10871@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=kernel-janitors@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox