blob: fc1f510edcce4be6f7933c2f87f552e436206dc0 [file] [log] [blame]
From 73fecb86c12cc70a33fe45b1351db1cf7a92cd6f Mon Sep 17 00:00:00 2001
From: Sudip Mukherjee <>
Date: Fri, 27 Dec 2019 17:44:34 +0000
Subject: [PATCH] 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 <>
Signed-off-by: Sudip Mukherjee <>
Cc: stable <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 5023c85ebc6e..044c3cbdcfa4 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -89,8 +89,7 @@ void tty_port_link_device(struct tty_port *port,
if (WARN_ON(index >= driver->num))
- if (!driver->ports[index])
- driver->ports[index] = port;
+ driver->ports[index] = port;