summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-05-12 13:50:34 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-15 21:44:45 -0700
commit1e0abb7e1844a7cb499321a94d5d04347ef86d68 (patch)
tree244a481482ddf8274f54c8729bcd806d366a9395 /drivers/usb/gadget
parent5512966643adb17483efc5f61481a38fc33088bb (diff)
downloadlinux-1e0abb7e1844a7cb499321a94d5d04347ef86d68.tar.bz2
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')
-rw-r--r--drivers/usb/gadget/imx_udc.c7
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
{
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;