lkml.org 
[lkml]   [2013]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] ipack: avoid double free on device->id
On Fri, Mar 08, 2013 at 09:21:45AM +0100, Samuel Iglesias Gonsalvez wrote:
> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
> ---
> drivers/ipack/ipack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c
> index 7ec6b20..599d4ff 100644
> --- a/drivers/ipack/ipack.c
> +++ b/drivers/ipack/ipack.c
> @@ -24,6 +24,7 @@ static void ipack_device_release(struct device *dev)
> {
> struct ipack_device *device = to_ipack_dev(dev);
> kfree(device->id);
> + device->id = NULL;

How does that keep anything from being freed twice?

> device->release(device);

device should now be gone after this call, right? What am I missing?

thanks,

greg k-h


\
 
 \ /
  Last update: 2013-03-08 19:21    [W:0.085 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site