From: Vitaly Bordug Date: Wed, 26 Sep 2007 20:36:22 +0000 (+0400) Subject: USB: serial gadget: Disable endpoints on unload X-Git-Tag: v2.6.24-rc1~1395^2~19 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=437f375f262417b484f28007c3e8d21bd01d0e01;p=linux-2.6 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index afdf71f76f..a2a1ebc947 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -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); }