Skip to content

Commit

Permalink
usb: cypress_m8 init error path fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mariusz Kozlowski authored and Greg Kroah-Hartman committed Dec 1, 2006
1 parent 93f1a47 commit 2e46b74
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2e46b74

Please sign in to comment.