mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 7/9] USB usbfs: destroy submitted urbs only on the disconnected interface
@ 2004-04-14 10:45 Duncan Sands
  2004-04-14 13:30 ` [linux-usb-devel] " Oliver Neukum
  2004-04-14 16:48 ` Alan Stern
  0 siblings, 2 replies; 18+ messages in thread
From: Duncan Sands @ 2004-04-14 10:45 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb-devel, linux-kernel, Frederic Detienne

The remaining three patches contain miscellaneous fixes to usbfs.
This one fixes up the disconnect callback to only shoot down urbs
on the disconnected interface, and not on all interfaces.  It also adds
a sanity check (this check is pointless because the interface could
never have been claimed in the first place if it failed, but I feel better
having it there).

 devio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
--- a/drivers/usb/core/devio.c	Wed Apr 14 12:18:20 2004
+++ b/drivers/usb/core/devio.c	Wed Apr 14 12:18:20 2004
@@ -341,6 +341,7 @@
 static void driver_disconnect(struct usb_interface *intf)
 {
 	struct dev_state *ps = usb_get_intfdata (intf);
+	unsigned int ifnum = intf->altsetting->desc.bInterfaceNumber;
 
 	if (!ps)
 		return;
@@ -349,11 +350,12 @@
 	 * all pending I/O requests; 2.6 does that.
 	 */
 
-	clear_bit(intf->cur_altsetting->desc.bInterfaceNumber, &ps->ifclaimed);
+	if (ifnum < 8*sizeof(ps->ifclaimed))
+		clear_bit(ifnum, &ps->ifclaimed);
 	usb_set_intfdata (intf, NULL);
 
 	/* force async requests to complete */
-	destroy_all_async (ps);
+	destroy_async_on_interface(ps, ifnum);
 }
 
 struct usb_driver usbdevfs_driver = {

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2004-04-17 19:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 10:45 [PATCH 7/9] USB usbfs: destroy submitted urbs only on the disconnected interface Duncan Sands
2004-04-14 13:30 ` [linux-usb-devel] " Oliver Neukum
2004-04-14 13:38   ` Duncan Sands
2004-04-14 15:00   ` Duncan Sands
2004-04-14 15:33     ` Oliver Neukum
2004-04-14 15:39       ` Duncan Sands
2004-04-14 20:39         ` Oliver Neukum
2004-04-15  8:05           ` Duncan Sands
2004-04-15  8:31             ` Oliver Neukum
2004-04-15  8:47               ` Duncan Sands
2004-04-15  9:08                 ` Oliver Neukum
2004-04-15  9:21                   ` Duncan Sands
2004-04-14 16:48 ` Alan Stern
2004-04-14 17:09   ` Duncan Sands
2004-04-14 17:55     ` Alan Stern
2004-04-17 18:31   ` Duncan Sands
2004-04-17 18:53     ` Duncan Sands
2004-04-17 19:52       ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®