Skip to content

Commit

Permalink
USB: imx_udc: fix leak in imx_ep_alloc_request()
Browse files Browse the repository at this point in the history
cppcheck found another leak in drivers/usb/gadget/imx_udc.c

Cc: Mike Lee <eemike@gmail.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Daniel Mack authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 5512966 commit 1e0abb7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/gadget/imx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,12 @@ static struct usb_request *imx_ep_alloc_request
{
struct imx_request *req;

if (!usb_ep)
return NULL;

req = kzalloc(sizeof *req, gfp_flags);
if (!req || !usb_ep)
return 0;
if (!req)
return NULL;

INIT_LIST_HEAD(&req->queue);
req->in_use = 0;
Expand Down

0 comments on commit 1e0abb7

Please sign in to comment.