]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB: Add missing cleanup to usb_register_root_hub()
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 25 Aug 2004 03:48:14 +0000 (20:48 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 25 Aug 2004 03:48:14 +0000 (20:48 -0700)
This patch adds some simple cleanups that are missing for one of the error
case in usb_register_root_hub().  I would be very surprised if this code
ever gets executed, but we might as well be correct.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/usb/core/hcd.c

index 620886033f6618b0adf17450040b67299f702925..08a3378bc8756d5e7bc8c90d28d6535dd36f32f6 100644 (file)
@@ -790,6 +790,8 @@ int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev
        usb_dev->epmaxpacketin[0] = usb_dev->epmaxpacketout[0] = 64;
        retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE);
        if (retval != sizeof usb_dev->descriptor) {
+               usb_dev->bus->root_hub = NULL;
+               up (&usb_bus_list_lock);
                dev_dbg (parent_dev, "can't read %s device descriptor %d\n",
                                usb_dev->dev.bus_id, retval);
                return (retval < 0) ? retval : -EMSGSIZE;