[USB] Fix connect/disconnect race
diff mbox series

Message ID 20031130074814.GA13002@gondor.apana.org.au
State New, archived
Headers show
Series
  • [USB] Fix connect/disconnect race
Related show

Commit Message

Herbert Xu Nov. 30, 2003, 7:48 a.m. UTC
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,

Comments

Greg KH Dec. 10, 2003, 1:38 a.m. UTC | #1
On Sun, Nov 30, 2003 at 06:48:14PM +1100, Herbert Xu wrote:
> 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

Thanks, I've applied this and will send it on.

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

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);