提交 e4abe665 编写于 作者: D Dave Young 提交者: Greg Kroah-Hartman

usb-serial: fix usb_serial_register bug when boot with nousb param

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: NDave Young <hidave.darkstar@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d0626808
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册