Skip to content

Commit 292c7f1

Browse files
sudipm-mukherjeegregkh
authored andcommitted
tty: always relink the port
commit 273f632 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: 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]>
1 parent 3d7cbd4 commit 292c7f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/tty/tty_port.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ void tty_port_link_device(struct tty_port *port,
8888
{
8989
if (WARN_ON(index >= driver->num))
9090
return;
91-
if (!driver->ports[index])
92-
driver->ports[index] = port;
91+
driver->ports[index] = port;
9392
}
9493
EXPORT_SYMBOL_GPL(tty_port_link_device);
9594

0 commit comments

Comments
 (0)