From: Felipe Balbi Date: Tue, 2 Apr 2013 14:06:28 +0000 (+0300) Subject: usb: gadget: udc-core: prevent a memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c5dbc220b327dc1ff5e0b1d829c091347511ed83;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Felipe Balbi --- 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;