diff options
author | Johan Hovold <johan@kernel.org> | 2017-03-30 15:46:30 +0200 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-03-31 13:14:39 +0200 |
commit | e1fdd5b2620198979b23abb679848a78461481e6 (patch) | |
tree | 040c81712c513d444187246ba8a3cb03ff0ec216 /drivers/usb/serial | |
parent | bc242fc107c71354181ba82bd9e539de8d088ae9 (diff) | |
download | linux-e1fdd5b2620198979b23abb679848a78461481e6.tar.bz2 |
USB: serial: drop obsolete open-race workaround
Commit a65a6f14dc24 ("USB: serial: fix race between probe and open")
fixed a race between probe and open, which could lead to crashes when a
not yet fully initialised port was being opened.
This race was later incidentally closed by commit 7e73eca6a7b2 ("TTY:
move cdev_add to tty_register_device") which moved character-device
registration from tty_register_driver to tty_register_device, which
isn't called until the port has been fully set up.
Remove the now redundant workaround which had the negative side effect
of not allowing a port to be opened immediately after user space had
been notified of a new tty device.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 0fa2030c275c..c7ca95f64edc 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -996,12 +996,6 @@ static 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 (allocate_minors(serial, num_ports)) { dev_err(ddev, "No more free serial minor numbers\n"); goto probe_error; @@ -1019,8 +1013,6 @@ static int usb_serial_probe(struct usb_interface *interface, dev_err(ddev, "Error registering port device, continuing\n"); } - serial->disconnected = 0; - if (num_ports > 0) usb_serial_console_init(serial->port[0]->minor); exit: |