Commit 6b793711 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Fail pending URBs in dummy_hcd upon disconnect

This patch fixes another bug in the dummy_hcd driver.  When a gadget
driver unregisters (simulating a device disconnect), dummy_hcd stops the
timer that it uses for processing outstanding URBs.  Unfortunately this
means that those URBs will never be given back.  The patch lets the timer
continue running; when it expires all the remaining URBs will fail so the
timer won't be reinitialized.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 67b7cb9a
......@@ -739,11 +739,9 @@ stop_activity (struct dummy *dum, struct usb_gadget_driver *driver)
struct dummy_ep *ep;
/* prevent any more requests */
dum->hdev = 0;
dum->address = 0;
/* this might not succeed ... */
del_timer (&dum->timer);
/* The timer is left running so that outstanding URBs can fail */
/* nuke any pending requests first, so driver i/o is quiesced */
list_for_each_entry (ep, &dum->gadget.ep_list, ep.ep_list)
......@@ -784,7 +782,6 @@ usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
driver_unregister (&driver->driver);
del_timer_sync (&dum->timer);
return 0;
}
EXPORT_SYMBOL (usb_gadget_unregister_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment