From 41888e962af026a557c4a274d41b86fb5d27c4ee Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 7 Dec 2003 21:28:46 -0800 Subject: [PATCH] [PATCH] USB: fix remove device after set_configuration 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 3fad1ec8b4a34..4bccdf0233488 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -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; } -- 2.53.0