Re: [PATCH] USB Fixes for 2.6.0-test11

From: Greg KH
Date: Wed Dec 10 2003 - 20:32:42 EST


ChangeSet 1.1524, 2003/12/09 17:40:44-08:00, herbert@xxxxxxxxxxxxxxxxxxx

[PATCH] USB: Fix connect/disconnect race

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


drivers/usb/core/hub.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c Wed Dec 10 16:47:01 2003
+++ b/drivers/usb/core/hub.c Wed Dec 10 16:47:01 2003
@@ -929,7 +929,6 @@
break;
}

- hub->children[port] = dev;
dev->state = USB_STATE_POWERED;

/* Reset the device, and detect its speed */
@@ -982,8 +981,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);
@@ -992,7 +993,6 @@
delay = HUB_LONG_RESET_TIME;
}

- hub->children[port] = NULL;
hub_port_disable(hub, port);
done:
up(&usb_address0_sem);

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