Skip to contentSkip to conversation

imx_udc: fix leak in imx_ep_alloc_request()

PATCH New Daniel Mack 1 participant 1 message Mar 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx_udc: fix leak in imx_ep_alloc_request()

cppcheck found another leak in drivers/usb/gadget/imx_udc.c

Cc Mike Lee <[email protected]>
Cc Darius Augulis <[email protected]>
---
 drivers/usb/gadget/imx_udc.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/usb/gadget/imx_udc.c +5 -2
index 77c5d0a..3ccd92c 100644
@@ -718,9 +718,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;
Signature · 1 line
1.6.2