[PATCH] Fix oopses with usb-serial devices (2.6.0-test4)

From: Greg KH
Date: Fri Aug 29 2003 - 15:48:04 EST


Hi,

Below is a small patch that fixes the oops that happens in the latest
2.6 kernels when you plug in a keyspan or whiteheat usb to serial
device. Thanks to Ben for pointing out that there is a problem, and to
Pat for finding where the problem was (in my code, not his :)

I'll be sending it on to Linus next week, but here is is for those
people who want to use their devices again.

thanks,

greg k-h


# USB: fix oops in keyspan and whiteheat devices when plugged in.

diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c Fri Aug 29 13:39:11 2003
+++ b/drivers/usb/serial/usb-serial.c Fri Aug 29 13:39:11 2003
@@ -871,7 +871,8 @@

/* the ports are cleaned up and released in port_release() */
for (i = 0; i < serial->num_ports; ++i)
- device_unregister(&serial->port[i]->dev);
+ if (serial->port[i]->dev.parent != NULL)
+ device_unregister(&serial->port[i]->dev);

/* If this is a "fake" port, we have to clean it up here, as it will
* not get cleaned up in port_release() as it was never registered with
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/