diff options
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 1c031309ab2..5d7b71b9614 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -1059,6 +1059,12 @@ int usb_serial_probe(struct usb_interface *interface, | |||
1059 | serial->attached = 1; | 1059 | serial->attached = 1; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | /* Avoid race with tty_open and serial_install by setting the | ||
1063 | * disconnected flag and not clearing it until all ports have been | ||
1064 | * registered. | ||
1065 | */ | ||
1066 | serial->disconnected = 1; | ||
1067 | |||
1062 | if (get_free_serial(serial, num_ports, &minor) == NULL) { | 1068 | if (get_free_serial(serial, num_ports, &minor) == NULL) { |
1063 | dev_err(&interface->dev, "No more free serial devices\n"); | 1069 | dev_err(&interface->dev, "No more free serial devices\n"); |
1064 | goto probe_error; | 1070 | goto probe_error; |
@@ -1083,6 +1089,8 @@ int usb_serial_probe(struct usb_interface *interface, | |||
1083 | } | 1089 | } |
1084 | } | 1090 | } |
1085 | 1091 | ||
1092 | serial->disconnected = 0; | ||
1093 | |||
1086 | usb_serial_console_init(debug, minor); | 1094 | usb_serial_console_init(debug, minor); |
1087 | 1095 | ||
1088 | exit: | 1096 | exit: |