public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [USB] Fix connect/disconnect race
@ 2003-11-30  7:48 Herbert Xu
  2003-12-10  1:38 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2003-11-30  7:48 UTC (permalink / raw)
  To: Greg KH, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

Hi Greg:

This patch was integrated by you in 2.4 six months ago.  Unfortunately
it never got into 2.5.  Without it you can end up with crashes such
as http://bugs.debian.org/218670

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1060 bytes --]

Index: kernel-source-2.5/drivers/usb/core/hub.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/usb/core/hub.c,v
retrieving revision 1.1.1.15
diff -u -r1.1.1.15 hub.c
--- kernel-source-2.5/drivers/usb/core/hub.c	28 Sep 2003 04:44:16 -0000	1.1.1.15
+++ kernel-source-2.5/drivers/usb/core/hub.c	30 Nov 2003 07:44:40 -0000
@@ -926,7 +926,6 @@
 			break;
 		}
 
-		hub->children[port] = dev;
 		dev->state = USB_STATE_POWERED;
 
 		/* Reset the device, and detect its speed */
@@ -979,8 +978,10 @@
 		dev->dev.parent = dev->parent->dev.parent->parent;
 
 		/* Run it through the hoops (find a driver, etc) */
-		if (!usb_new_device(dev, &hub->dev))
+		if (!usb_new_device(dev, &hub->dev)) {
+			hub->children[port] = dev;
 			goto done;
+		}
 
 		/* Free the configuration if there was an error */
 		usb_put_dev(dev);
@@ -989,7 +990,6 @@
 		delay = HUB_LONG_RESET_TIME;
 	}
 
-	hub->children[port] = NULL;
 	hub_port_disable(hub, port);
 done:
 	up(&usb_address0_sem);

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <mailman.1070178780.32610.linux-kernel2news@redhat.com>]

end of thread, other threads:[~2003-12-10  2:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-30  7:48 [USB] Fix connect/disconnect race Herbert Xu
2003-12-10  1:38 ` Greg KH
     [not found] <mailman.1070178780.32610.linux-kernel2news@redhat.com>
2003-12-01  2:03 ` Pete Zaitcev
2003-12-01  7:16   ` Herbert Xu

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