diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-05-12 16:50:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:45 -0400 |
commit | 1e0abb7e1844a7cb499321a94d5d04347ef86d68 (patch) | |
tree | 244a481482ddf8274f54c8729bcd806d366a9395 /drivers/usb/gadget/imx_udc.c | |
parent | 5512966643adb17483efc5f61481a38fc33088bb (diff) |
USB: imx_udc: fix leak in imx_ep_alloc_request()
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>
Diffstat (limited to 'drivers/usb/gadget/imx_udc.c')
-rw-r--r-- | drivers/usb/gadget/imx_udc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index 168658b4b4e2..239bf8ed9f4a 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c | |||
@@ -734,9 +734,12 @@ static struct usb_request *imx_ep_alloc_request | |||
734 | { | 734 | { |
735 | struct imx_request *req; | 735 | struct imx_request *req; |
736 | 736 | ||
737 | if (!usb_ep) | ||
738 | return NULL; | ||
739 | |||
737 | req = kzalloc(sizeof *req, gfp_flags); | 740 | req = kzalloc(sizeof *req, gfp_flags); |
738 | if (!req || !usb_ep) | 741 | if (!req) |
739 | return 0; | 742 | return NULL; |
740 | 743 | ||
741 | INIT_LIST_HEAD(&req->queue); | 744 | INIT_LIST_HEAD(&req->queue); |
742 | req->in_use = 0; | 745 | req->in_use = 0; |