Skip to content

Commit

Permalink
tty: always relink the port
Browse files Browse the repository at this point in the history
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: fb2b900 ("tty: link tty and port before configuring it as console")
Reported-by: Kenneth R. Crudup <[email protected]>
Signed-off-by: Sudip Mukherjee <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Dec 30, 2019
1 parent 46cf053 commit 273f632
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/tty/tty_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,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);

Expand Down

0 comments on commit 273f632

Please sign in to comment.