Re: [PATCH] remove explicit devm_kfree

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

 



On Fri, Aug 15, 2014 at 08:56:05PM +0530, Arjun Sreedharan wrote:
> Memory allocated with devm_kzalloc() is freed automatically when device
> out of scope.

But in this case the device does not necessarily goes "out of scope" and we
still want to release memory.

Thanks.

> 
> Signed-off-by: Arjun Sreedharan <arjun024@xxxxxxxxx>
> ---
>  drivers/input/misc/soc_button_array.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
> index 5a6334b..123e59f 100644
> --- a/drivers/input/misc/soc_button_array.c
> +++ b/drivers/input/misc/soc_button_array.c
> @@ -131,7 +131,6 @@ soc_button_device_create(struct pnp_dev *pdev,
>  err_free_pdev:
>  	platform_device_put(pd);
>  err_free_mem:
> -	devm_kfree(&pdev->dev, gpio_keys_pdata);
>  	return ERR_PTR(error);
>  }
>  
> -- 
> 1.7.11.7
> 

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux