Commit c5dbc220 authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 1cb5e9ee
......@@ -240,6 +240,7 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
err2:
put_device(&gadget->dev);
kfree(udc);
err1:
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment