patch-2.4.12 linux/drivers/usb/serial/omninet.c

Next file: linux/drivers/usb/serial/pl2303.c
Previous file: linux/drivers/usb/serial/mct_u232.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.11/linux/drivers/usb/serial/omninet.c linux/drivers/usb/serial/omninet.c
@@ -216,14 +216,15 @@
 	--port->open_count;
 
 	if (port->open_count <= 0) {
-		od = (struct omninet_data *)port->private;
-		wport = &serial->port[1];
-
-		usb_unlink_urb (wport->write_urb);
-		usb_unlink_urb (port->read_urb);
+		if (serial->dev) {
+			wport = &serial->port[1];
+			usb_unlink_urb (wport->write_urb);
+			usb_unlink_urb (port->read_urb);
+		}
 
 		port->active = 0;
 		port->open_count = 0;
+		od = (struct omninet_data *)port->private;
 		if (od)
 			kfree(od);
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)