提交 1e0abb7e 编写于 作者: D Daniel Mack 提交者: Greg Kroah-Hartman

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: NDaniel Mack <daniel@caiaq.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 55129666
...@@ -734,9 +734,12 @@ static struct usb_request *imx_ep_alloc_request ...@@ -734,9 +734,12 @@ static struct usb_request *imx_ep_alloc_request
{ {
struct imx_request *req; struct imx_request *req;
if (!usb_ep)
return NULL;
req = kzalloc(sizeof *req, gfp_flags); req = kzalloc(sizeof *req, gfp_flags);
if (!req || !usb_ep) if (!req)
return 0; return NULL;
INIT_LIST_HEAD(&req->queue); INIT_LIST_HEAD(&req->queue);
req->in_use = 0; req->in_use = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册