Skip to content

Commit

Permalink
usb-serial: fix usb_serial_register bug when boot with nousb param
Browse files Browse the repository at this point in the history
With "nousb" cmdline booting, built-in serial drivers (ie. airecable)
will trigger kernel oops.

Indeed, if nousb, usb_serial_init will failed, and the usb serial bus type
will not be registerd, then usb_serial_register call driver_register
which try to register the driver to a not registered bus.

Here add usb_disabled() check in usb_serial_register to fix it.

Signed-off-by: Dave Young <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
hidave authored and gregkh committed Mar 24, 2009
1 parent d062680 commit e4abe66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,9 @@ int usb_serial_register(struct usb_serial_driver *driver)
/* must be called with BKL held */
int retval;

if (usb_disabled())
return -ENODEV;

fixup_generic(driver);

if (!driver->description)
Expand Down

0 comments on commit e4abe66

Please sign in to comment.