Skip to content

Commit

Permalink
USB: serial gadget: Disable endpoints on unload
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vitaly Bordug authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent a59048d commit 437f375
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/usb/gadget/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 437f375

Please sign in to comment.