提交 c5dbc220 编写于 作者: F 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册