Details
[Home]
Issue of the Implementation # L0291
Brief
USB: Gadget core: fix inconsistency in the interface usb_add_gadget_udc_release()
Detailed Description
The usb_add_gadget_udc_release() routine in the USB gadget core will sometimes but not always call the gadget's release function when an error occurs. More specifically, if the struct usb_udc allocation fails then the release function is not called, and for other errors it is. As a result, users of this routine cannot know whether they need to deallocate the memory containing the gadget structure following an error. This leads to unavoidable memory leaks or double frees.
Component
linux-kernel 4.13
Accepted
https://patchwork.kernel.org/patch/9906907/
commit
Status
Fixed in kernel 4.14-rc1
[Home]