ChangeSet 1.1276.22.3, 2003/08/22 15:31:33-07:00, bellucda@tiscali.it [PATCH] USB: PATCH 3/19 Audit usb_register/usb_serial_register under divers/usb/serial drivers/usb/serial/digi_acceleport.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c --- a/drivers/usb/serial/digi_acceleport.c Tue Sep 2 12:48:12 2003 +++ b/drivers/usb/serial/digi_acceleport.c Tue Sep 2 12:48:12 2003 @@ -2045,11 +2045,24 @@ static int __init digi_init (void) { - usb_serial_register (&digi_acceleport_2_device); - usb_serial_register (&digi_acceleport_4_device); - usb_register (&digi_driver); + int retval; + retval = usb_serial_register(&digi_acceleport_2_device); + if (retval) + goto failed_acceleport_2_device; + retval = usb_serial_register(&digi_acceleport_4_device); + if (retval) + goto failed_acceleport_4_device; + retval = usb_register(&digi_driver); + if (retval) + goto failed_usb_register; info(DRIVER_VERSION ":" DRIVER_DESC); return 0; +failed_usb_register: + usb_serial_deregister(&digi_acceleport_4_device); +failed_acceleport_4_device: + usb_serial_deregister(&digi_acceleport_2_device); +failed_acceleport_2_device: + return retval; }