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

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

parents e6538c2a 9802afd7
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);
	}