• Aaro Koskinen's avatar
    USB: omap_udc: fix crashes on probe error and module removal · a2aa761a
    Aaro Koskinen authored
    [ Upstream commit 99f700366fcea1aa2fa3c49c99f371670c3c62f8 ]
    
    We currently crash if usb_add_gadget_udc_release() fails, since the
    udc->done is not initialized until in the remove function.
    Furthermore, on module removal the udc data is accessed although
    the release function is already triggered by usb_del_gadget_udc()
    early in the function.
    
    Fix by rewriting the release and remove functions, basically moving
    all the cleanup into the release function, and doing the completion
    only in the module removal case.
    
    The patch fixes omap_udc module probe with a failing gadged, and also
    allows the removal of omap_udc. Tested by running "modprobe omap_udc;
    modprobe -r omap_udc" in a loop.
    Signed-off-by: 's avatarAaro Koskinen <aaro.koskinen@iki.fi>
    Signed-off-by: 's avatarFelipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    a2aa761a
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...