usb: gadget: udc-core: prevent a memory leak
authorFelipe Balbi <balbi@ti.com>
Tue, 2 Apr 2013 14:06:28 +0000 (17:06 +0300)
committerFelipe Balbi <balbi@ti.com>
Tue, 2 Apr 2013 14:07:06 +0000 (17:07 +0300)
commitc5dbc220b327dc1ff5e0b1d829c091347511ed83
tree535cdf0179977a3b36b533fe008e220f31971220
parent1cb5e9ee033f89d3241013cfff8300cc0195a62d
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>
drivers/usb/gadget/udc-core.c