ChangeSet 1.1276.1.19, 2003/08/27 10:49:22-07:00, bellucda@tiscali.it [PATCH] Audit and minor cleanups in drivers/usb/* - audit video_register_device - if usb_register fails report back its return code rather than -1 drivers/usb/media/dsbr100.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/media/dsbr100.c b/drivers/usb/media/dsbr100.c --- a/drivers/usb/media/dsbr100.c Tue Sep 2 12:45:31 2003 +++ b/drivers/usb/media/dsbr100.c Tue Sep 2 12:45:31 2003 @@ -354,15 +354,23 @@ static int __init dsbr100_init(void) { + int retval; usb_dsbr100_radio.priv = NULL; - usb_register(&usb_dsbr100_driver); - if (video_register_device(&usb_dsbr100_radio, VFL_TYPE_RADIO, - radio_nr)==-1) { + retval = usb_register(&usb_dsbr100_driver); + if (retval) + goto failed_usb_register; + retval = video_register_device(&usb_dsbr100_radio, VFL_TYPE_RADIO, + radio_nr); + if (retval) { warn("Couldn't register video device"); - return -EINVAL; + goto failed_video_register; } info(DRIVER_VERSION ":" DRIVER_DESC); return 0; +failed_video_register: + usb_deregister(&usb_dsbr100_driver); +failed_usb_register: + return retval; } static void __exit dsbr100_exit(void)