ChangeSet 1.1276.22.11, 2003/08/22 15:33:32-07:00, bellucda@tiscali.it [PATCH] USB: PATCH 11/19 Audit usb_register/usb_serial_register under divers/usb/serial drivers/usb/serial/keyspan_pda.c | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c --- a/drivers/usb/serial/keyspan_pda.c Tue Sep 2 12:47:38 2003 +++ b/drivers/usb/serial/keyspan_pda.c Tue Sep 2 12:47:38 2003 @@ -876,16 +876,39 @@ static int __init keyspan_pda_init (void) { - usb_serial_register (&keyspan_pda_device); + int retval; + retval = usb_serial_register(&keyspan_pda_device); + if (retval) + goto failed_pda_register; #ifdef KEYSPAN - usb_serial_register (&keyspan_pda_fake_device); + retval = usb_serial_register(&keyspan_pda_fake_device); + if (retval) + goto failed_pda_fake_register; #endif #ifdef XIRCOM - usb_serial_register (&xircom_pgs_fake_device); + retval = usb_serial_register(&xircom_pgs_fake_device); + if (retval) + goto failed_xircom_register; #endif - usb_register (&keyspan_pda_driver); + retval = usb_register(&keyspan_pda_driver); + if (retval) + goto failed_usb_register; info(DRIVER_DESC " " DRIVER_VERSION); return 0; +failed_usb_register: +#ifdef XIRCOM + usb_serial_deregister(&xircom_pgs_fake_device); +failed_xircom_register: +#endif /* XIRCOM */ +#ifdef KEYSPAN + usb_serial_deregister(&keyspan_pda_fake_device); +#endif +#ifdef KEYSPAN +failed_pda_fake_register: +#endif + usb_serial_deregister(&keyspan_pda_device); +failed_pda_register: + return retval; }