public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] usb-serial : fix the nousb oops
@ 2009-02-01 10:53 Dave Young
  2009-02-01 15:51 ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Young @ 2009-02-01 10:53 UTC (permalink / raw)
  To: wgreathouse, linux-usb, linux-kernel


In case with "nousb" booting, serial drivers will trigger kernel oops.

Here add usb_disabled() check in usb_serial_init and usb_serial_register

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
drivers/usb/serial/usb-serial.c |    6 ++++++
1 file changed, 6 insertions(+)

diff -uprN a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c	2009-02-01 13:11:11.000000000 +0800
+++ b/drivers/usb/serial/usb-serial.c	2009-02-01 13:24:32.000000000 +0800
@@ -1113,6 +1113,9 @@ static int __init usb_serial_init(void)
 	int i;
 	int result;
 
+	if (usb_disabled())
+		return -ENODEV;
+
 	usb_serial_tty_driver = alloc_tty_driver(SERIAL_TTY_MINORS);
 	if (!usb_serial_tty_driver)
 		return -ENOMEM;
@@ -1230,6 +1233,9 @@ int usb_serial_register(struct usb_seria
 	/* must be called with BKL held */
 	int retval;
 
+	if (usb_disabled())
+		return -ENODEV;
+
 	fixup_generic(driver);
 
 	if (!driver->description)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-02-06  2:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-01 10:53 [PATCH 1/2] usb-serial : fix the nousb oops Dave Young
2009-02-01 15:51 ` Greg KH
2009-02-02  1:43   ` Dave Young
2009-02-02 10:11     ` Dave Young
2009-02-03 23:58     ` Greg KH
2009-02-04  1:10       ` Dave Young
2009-02-04 23:59         ` Greg KH
2009-02-05  9:33           ` Dave Young
2009-02-06  2:16           ` Dave Young
2009-02-04  8:12       ` Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox