mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
USB: serial gadget: Disable endpoints on unload
After Serial gadget is being unloaded, neither serial itself, nor other gadget stuff can be loaded subsequently. Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a59048d463
commit
437f375f26
@ -1470,6 +1470,12 @@ static void /* __init_or_exit */ gs_unbind(struct usb_gadget *gadget)
|
||||
dev->dev_ctrl_req = NULL;
|
||||
}
|
||||
gs_free_ports(dev);
|
||||
if (dev->dev_notify_ep)
|
||||
usb_ep_disable(dev->dev_notify_ep);
|
||||
if (dev->dev_in_ep)
|
||||
usb_ep_disable(dev->dev_in_ep);
|
||||
if (dev->dev_out_ep)
|
||||
usb_ep_disable(dev->dev_out_ep);
|
||||
kfree(dev);
|
||||
set_gadget_data(gadget, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user