diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2019-12-27 17:44:34 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-14 20:04:30 +0100 |
commit | 017927206a69a109c0ecd4646c7b1cdd2883e4b5 (patch) | |
tree | cb902642a135bc37ea7b61a43becaa763991d86e | |
parent | caeb5e1b50b7809f6b865361d36456c19bc31b3e (diff) | |
download | linux-stable-017927206a69a109c0ecd4646c7b1cdd2883e4b5.tar.gz linux-stable-017927206a69a109c0ecd4646c7b1cdd2883e4b5.tar.bz2 linux-stable-017927206a69a109c0ecd4646c7b1cdd2883e4b5.zip |
tty: always relink the port
commit 273f632912f1b24b642ba5b7eb5022e43a72f3b5 upstream.
If the serial device is disconnected and reconnected, it re-enumerates
properly but does not link it. fwiw, linking means just saving the port
index, so allow it always as there is no harm in saving the same value
again even if it tries to relink with the same port.
Fixes: fb2b90014d78 ("tty: link tty and port before configuring it as console")
Reported-by: Kenneth R. Crudup <kenny@panix.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191227174434.12057-1-sudipm.mukherjee@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/tty_port.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 9650603157f6..7f2f20b74d1d 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -48,8 +48,7 @@ void tty_port_link_device(struct tty_port *port, { if (WARN_ON(index >= driver->num)) return; - if (!driver->ports[index]) - driver->ports[index] = port; + driver->ports[index] = port; } EXPORT_SYMBOL_GPL(tty_port_link_device); |