ChangeSet 1.1276.1.63, 2003/08/29 13:56:15-07:00, greg@kroah.com

[PATCH] USB: fix oops in keyspan and whiteheat devices when plugged in.

Thanks to Pat Mochel for finding out where the error was for this bug.


 drivers/usb/serial/usb-serial.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c	Tue Sep  2 12:42:38 2003
+++ b/drivers/usb/serial/usb-serial.c	Tue Sep  2 12:42:38 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