]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] USB: fix remove device after set_configuration
authorDavid Brownell <david-b@pacbell.net>
Mon, 8 Dec 2003 05:28:46 +0000 (21:28 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 8 Dec 2003 05:28:46 +0000 (21:28 -0800)
If a device can't be configured, the current test9 code forgets
to clean it out of sysfs.  This resolves that issue, so the retry
in usb_new_device() stands a chance of working.

The enumeration code still doesn't handle such errors well, but
at least this way that hub port can be used for another device.

drivers/usb/core/usb.c

index 3fad1ec8b4a34434bc0d7de292fcaf6a39fd1f3f..4bccdf0233488b42e77ad53b43716ae5782b37a9 100644 (file)
@@ -1120,6 +1120,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
        if (err) {
                dev_err(&dev->dev, "can't set config #%d, error %d\n",
                        dev->config[0].desc.bConfigurationValue, err);
+               device_del(&dev->dev);
                goto fail;
        }