Re: [patch] leds: pca9532: free after input_unregister_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Acked-by: Dmitry Torokhov <dtor@xxxxxxx>

> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux