ChangeSet 1.1276.22.8, 2003/08/22 15:32:51-07:00, bellucda@tiscali.it [PATCH] USB: PATCH 8/19 Audit usb_register/usb_serial_register under divers/usb/serial drivers/usb/serial/ipaq.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c --- a/drivers/usb/serial/ipaq.c Tue Sep 2 12:47:50 2003 +++ b/drivers/usb/serial/ipaq.c Tue Sep 2 12:47:50 2003 @@ -570,16 +570,25 @@ static int __init ipaq_init(void) { + int retval; spin_lock_init(&write_list_lock); - usb_serial_register(&ipaq_device); + retval = usb_serial_register(&ipaq_device); + if (retval) + goto failed_usb_serial_register; info(DRIVER_DESC " " DRIVER_VERSION); if (vendor) { ipaq_id_table[0].idVendor = vendor; ipaq_id_table[0].idProduct = product; } - usb_register(&ipaq_driver); - + retval = usb_register(&ipaq_driver); + if (retval) + goto failed_usb_register; + return 0; +failed_usb_register: + usb_serial_deregister(&ipaq_device); +failed_usb_serial_register: + return retval; }