Hi!

Here's a kernel oops patch I recently made for a usbserial-post-kludge patched 2.4.23. It fixes an oops due to a pointer dereference in a down() inside the serial_write() function. The attached patch is against 2.4.30-rc1 since I
don't have bitkeeper.


I tracked it down with the help of three table lamps with flourescent light which I turned on & off swiftly to generate EMI that disconnected an FTDI 232BM based usb<-->serial device. (Very useful actually!) See the following for my setup:

        http://vmlinux.org/jocke/linux/jnn-patches/images/usbserial-oops/
        http://vmlinux.org/jocke/linux/jnn-patches/oopses/usbserial.txt

The latter will be uploaded tomorrow when I'm back at work.

Regards
 /Jocke
diff -Nru linux-2.4.30-rc1/drivers/usb/serial/usbserial.c linux-2.4.30-rc1-jnn/drivers/usb/serial/usbserial.c
--- linux-2.4.30-rc1/drivers/usb/serial/usbserial.c	2005-03-20 11:55:20.897385492 +0100
+++ linux-2.4.30-rc1-jnn/drivers/usb/serial/usbserial.c	2005-03-21 00:07:03.359567018 +0100
@@ -715,6 +715,9 @@
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
 	int rc;
 
+	if (!port)
+		return -ENODEV;
+
 	if (!in_interrupt()) {
 		/*
 		 * Run post_list to reduce a possiblity of reordered writes.

Reply via email to