|
@@ -1059,6 +1059,12 @@ int usb_serial_probe(struct usb_interface *interface,
|
|
|
serial->attached = 1;
|
|
|
}
|
|
|
|
|
|
+ /* Avoid race with tty_open and serial_install by setting the
|
|
|
+ * disconnected flag and not clearing it until all ports have been
|
|
|
+ * registered.
|
|
|
+ */
|
|
|
+ serial->disconnected = 1;
|
|
|
+
|
|
|
if (get_free_serial(serial, num_ports, &minor) == NULL) {
|
|
|
dev_err(&interface->dev, "No more free serial devices\n");
|
|
|
goto probe_error;
|
|
@@ -1078,6 +1084,8 @@ int usb_serial_probe(struct usb_interface *interface,
|
|
|
"continuing\n");
|
|
|
}
|
|
|
|
|
|
+ serial->disconnected = 0;
|
|
|
+
|
|
|
usb_serial_console_init(debug, minor);
|
|
|
|
|
|
exit:
|