Unverified Commit 170b758d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12812 serial: protect uart_port_dtr_rts() in uart_shutdown() too

parents 4f5b3a4d 2fd4f202
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -286,7 +286,8 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
		/*
		 * Turn off DTR and RTS early.
		 */
		if (uport && uart_console(uport) && tty) {
		if (uport) {
			if (uart_console(uport) && tty) {
				uport->cons->cflag = tty->termios.c_cflag;
				uport->cons->ispeed = tty->termios.c_ispeed;
				uport->cons->ospeed = tty->termios.c_ospeed;
@@ -294,6 +295,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)

			if (!tty || C_HUPCL(tty))
				uart_port_dtr_rts(uport, 0);
		}

		uart_port_shutdown(port);
	}