tty: always relink the port
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 27 Dec 2019 17:44:34 +0000 (17:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jan 2020 19:07:06 +0000 (20:07 +0100)
commit1656f00becca4b6aa3e6992e6a6304dd74ec473b
treed61d01dde665c65f9299fed1edf925719f44f02a
parent65c6710c3fab92dcdf924c1a6daf75439f7f3199
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>
drivers/tty/tty_port.c