[PATCH 9/9] tty: serial_core: add tty NULL check in uart_port_startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If we don't have a tty when calling uart_port_startup, skip the baudrate
and modem control setup which depend on tty->termios struct. Either
tty_port clients will configure the line in a separate call or we'll
move termios into the tty_port.

Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
---
 drivers/tty/serial/serial_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b9ec9fd688a2..2c3b187d517b 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -199,7 +199,7 @@ static int uart_port_startup(struct tty_port *port, int init_hw)
 	}
 
 	retval = uport->ops->startup(uport);
-	if (retval == 0) {
+	if (retval == 0 && tty) {
 		if (uart_console(uport) && uport->cons->cflag) {
 			tty->termios.c_cflag = uport->cons->cflag;
 			uport->cons->cflag = 0;
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux