ChangeSet 1.1276.22.19, 2003/08/22 15:35:22-07:00, bellucda@tiscali.it [PATCH] USB: PATCH 19/19 Audit usb_register/usb_serial_register under divers/usb/serial drivers/usb/serial/whiteheat.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c --- a/drivers/usb/serial/whiteheat.c Tue Sep 2 12:47:04 2003 +++ b/drivers/usb/serial/whiteheat.c Tue Sep 2 12:47:04 2003 @@ -1486,11 +1486,24 @@ *****************************************************************************/ static int __init whiteheat_init (void) { - usb_serial_register (&whiteheat_fake_device); - usb_serial_register (&whiteheat_device); - usb_register (&whiteheat_driver); + int retval; + retval = usb_serial_register(&whiteheat_fake_device); + if (retval) + goto failed_fake_register; + retval = usb_serial_register(&whiteheat_device); + if (retval) + goto failed_device_register; + retval = usb_register(&whiteheat_driver); + if (retval) + goto failed_usb_register; info(DRIVER_DESC " " DRIVER_VERSION); return 0; +failed_usb_register: + usb_serial_deregister(&whiteheat_device); +failed_device_register: + usb_serial_deregister(&whiteheat_fake_device); +failed_fake_register: + return retval; }