public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] leds: pca9532: free after input_unregister_device()
@ 2010-11-12  4:30 Dan Carpenter
  2010-11-12  5:21 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-11-12  4:30 UTC (permalink / raw)
  To: kernel-janitors

input_unregister_device() frees data->idev so the second
input_free_device() is a double free.

Signed-off-by: Dan Carpenter <error27@gmail.com>

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;
 			}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] leds: pca9532: free after input_unregister_device()
  2010-11-12  4:30 [patch] leds: pca9532: free after input_unregister_device() Dan Carpenter
@ 2010-11-12  5:21 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2010-11-12  5:21 UTC (permalink / raw)
  To: kernel-janitors

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-12  5:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-12  4:30 [patch] leds: pca9532: free after input_unregister_device() Dan Carpenter
2010-11-12  5:21 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox