- missing check in usb/serial/usb-serial.c.
Subsystems (2)
PATCH 1/2 - missing check in usb/serial/usb-serial.c.
Hi Greg,
This patch add a missing check in the call to bus_register() and
not initialise `result' (which is not necessary).
Signed-off-by Luiz Capitulino <[email protected]>
drivers/usb/serial/usb-serial.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-)
drivers/usb/serial/usb-serial.c +13 -6
@@ -1229,7 +1229,7 @@ struct tty_driver *usb_serial_tty_driverstatic int __init usb_serial_init (void ) {int i; -int result =0 ; +int result; usb_serial_tty_driver =alloc_tty_driver (SERIAL_TTY_MINORS );if (!usb_serial_tty_driver)
@@ -1240,13 +1240,17 @@ static int __init usb_serial_init(void) serial_table[i] =NULL ; } -bus_register (&usb_serial_bus_type); + result =bus_register (&usb_serial_bus_type); +if (result) { +err ("%s - registering bus driver failed" , __FUNCTION__); + goto exit_bus; + }/* register the generic driver, if we should */ result =usb_serial_generic_register (debug);if (result <0 ) {err ("%s - registering generic driver failed" , __FUNCTION__); - goto exit; + goto exit_generic; } usb_serial_tty_driver->owner =THIS_MODULE ;
@@ -1264,7 +1268,7 @@ static int __init usb_serial_init(void) result =tty_register_driver (usb_serial_tty_driver);if (result) {err ("%s - tty_register_driver failed" , __FUNCTION__); - goto exit_generic; + goto exit_reg_driver; }/* register the USB driver */
@@ -1281,10 +1285,13 @@ static int __init usb_serial_init(void) exit_tty:tty_unregister_driver (usb_serial_tty_driver); -exit_generic: +exit_reg_driver:usb_serial_generic_deregister (); -exit: +exit_generic: +bus_unregister (&usb_serial_bus_type); + +exit_bus:err ("%s - returning with error %d" , __FUNCTION__, result);put_tty_driver (usb_serial_tty_driver);return result;
Greg KH
AppliedQuoted 5 lines · Luiz Fernando N. Capitulino
Hi Greg,
This patch add a missing check in the call to
bus_register()and
not initialise `result' (which is not necessary).
Applied, thanks.
greg k-h