mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-10 16:42:21 +00:00
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>
This commit is contained in:
parent
5512966643
commit
1e0abb7e18
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue