lkml.org 
[lkml]   [2011]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers/usb/gadget/inode.c: add missing kfree
On Thu, 2 Jun 2011, Julia Lawall wrote:

> From: Julia Lawall <julia@diku.dk>
>
> The label fail frees dev->buf, but kbuf hasn't yet been stored there at
> this point.

...

> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> I wonder if it is really correct to free dev->buf at fail in this case.
> Because it is freeing the previously allocated value of dev->buf, not the
> current one as done in subsequent cases.

I don't think it matters. This check is probably there only for
safety; it should not be possible for dev->buf to be non-NULL at this
point. You ought to be able to remove the entire

if (dev->buf)
goto fail;

statement with no ill effects.

Alan Stern



\
 
 \ /
  Last update: 2011-06-02 16:55    [W:0.410 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site