Messages in this thread Patch in this message | | | Date | Sun, 30 Nov 2003 18:48:14 +1100 | Subject | [USB] Fix connect/disconnect race | From | Herbert Xu <> |
| |
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 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); | |