usb/hcd: don't return 0 on error in usb_add_hcd()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 14 Apr 2011 09:22:32 +0000 (11:22 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 30 Apr 2011 00:24:35 +0000 (17:24 -0700)
If USB type detections fails, we run into default and return 0.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hcd.c

index 77a7faec8d78a0e7efa8c15f2d96a0b40a538130..10936ba9c42b26805252d2bdf99a7abb32223651 100644 (file)
@@ -2407,6 +2407,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
                rhdev->speed = USB_SPEED_SUPER;
                break;
        default:
+               retval = -EINVAL;
                goto err_set_rh_speed;
        }