usb: cypress_m8 init error path fix
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Fri, 17 Nov 2006 16:49:22 +0000 (17:49 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:23:37 +0000 (14:23 -0800)
If at some point cypress_init() fails deregister
only the resources that were registered until that point.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/cypress_m8.c

index f2e89a083659c21374407a1e7f23e0fa1e17e0a6..093f303b3189d2a515a467e8c32598a5626aceca 100644 (file)
@@ -1684,15 +1684,14 @@ static int __init cypress_init(void)
 
        info(DRIVER_DESC " " DRIVER_VERSION);
        return 0;
+
 failed_usb_register:
-       usb_deregister(&cypress_driver);
-failed_ca42v2_register:
        usb_serial_deregister(&cypress_ca42v2_device);
-failed_hidcom_register:
+failed_ca42v2_register:
        usb_serial_deregister(&cypress_hidcom_device);
-failed_em_register:
+failed_hidcom_register:
        usb_serial_deregister(&cypress_earthmate_device);
-
+failed_em_register:
        return retval;
 }