ChangeSet 1.1276.22.17, 2003/08/22 15:34:56-07:00, bellucda@tiscali.it [PATCH] USB: PATCH 17/19 Audit usb_register/usb_serial_register under divers/usb/serial drivers/usb/serial/safe_serial.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c --- a/drivers/usb/serial/safe_serial.c Tue Sep 2 12:47:12 2003 +++ b/drivers/usb/serial/safe_serial.c Tue Sep 2 12:47:12 2003 @@ -422,7 +422,7 @@ static int __init safe_init (void) { - int i; + int i, retval; info (DRIVER_VERSION " " DRIVER_AUTHOR); info (DRIVER_DESC); @@ -441,10 +441,18 @@ } } - usb_serial_register (&safe_device); - usb_register (&safe_driver); + retval = usb_serial_register(&safe_device); + if (retval) + goto failed_usb_serial_register; + retval = usb_register(&safe_driver); + if (retval) + goto failed_usb_register; return 0; +failed_usb_register: + usb_serial_deregister(&safe_device); +failed_usb_serial_register: + return retval; } static void __exit safe_exit (void)