Commit 49849c75 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Khalid Elmously

tty: always relink the port

BugLink: https://bugs.launchpad.net/bugs/1859865

commit 273f6329 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: fb2b9001 ("tty: link tty and port before configuring it as console")
Reported-by: default avatarKenneth R. Crudup <kenny@panix.com>
Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191227174434.12057-1-sudipm.mukherjee@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent d15bd8f2
......@@ -48,7 +48,6 @@ void tty_port_link_device(struct tty_port *port,
{
if (WARN_ON(index >= driver->num))
return;
if (!driver->ports[index])
driver->ports[index] = port;
}
EXPORT_SYMBOL_GPL(tty_port_link_device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment