ChangeSet 1.1276.1.36, 2003/08/27 11:29:54-07:00, bellucda@tiscali.it [PATCH] Another bad audit in drivers/usb/*: cdc-acm Changes: - if tty_register_driver report back its return code rather than -1 - if usb_register fails report back its return code rather than -1 drivers/usb/class/cdc-acm.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c --- a/drivers/usb/class/cdc-acm.c Tue Sep 2 12:44:24 2003 +++ b/drivers/usb/class/cdc-acm.c Tue Sep 2 12:44:24 2003 @@ -767,6 +767,7 @@ static int __init acm_init(void) { + int retval; acm_tty_driver = alloc_tty_driver(ACM_TTY_MINORS); if (!acm_tty_driver) return -ENOMEM; @@ -783,15 +784,17 @@ acm_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; tty_set_operations(acm_tty_driver, &acm_ops); - if (tty_register_driver(acm_tty_driver)) { + retval = tty_register_driver(acm_tty_driver); + if (retval) { put_tty_driver(acm_tty_driver); - return -1; + return retval; } - if (usb_register(&acm_driver) < 0) { + retval = usb_register(&acm_driver); + if (retval) { tty_unregister_driver(acm_tty_driver); put_tty_driver(acm_tty_driver); - return -1; + return retval; } info(DRIVER_VERSION ":" DRIVER_DESC);