diff options
author | Felipe Balbi <balbi@ti.com> | 2013-04-02 16:06:28 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-04-02 16:07:06 +0200 |
commit | c5dbc220b327dc1ff5e0b1d829c091347511ed83 (patch) | |
tree | 535cdf0179977a3b36b533fe008e220f31971220 /drivers/usb/gadget | |
parent | usb: gadget: fusb300_udc: bug fix of not doing idma reset for each time (diff) | |
download | linux-c5dbc220b327dc1ff5e0b1d829c091347511ed83.tar.xz linux-c5dbc220b327dc1ff5e0b1d829c091347511ed83.zip |
usb: gadget: udc-core: prevent a memory leak
udc-core would leak 'udc' memory in some error
cases. Fix it by kfree()ing udc on error path.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/udc-core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index 7999cc656979..c6c2b5611b43 100644 --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c @@ -240,6 +240,7 @@ err3: err2: put_device(&gadget->dev); + kfree(udc); err1: return ret; |