Message ID | 1592052665-95042-1-git-send-email-xiyuyang19@fudan.edu.cn |
---|---|
State | New |
Headers | show |
Series | tty: serial_core: Fix uart_state leak when port shutdown | expand |
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 57840cf90388..ab8756ef2b60 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -313,7 +313,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) * console driver may need to allocate/free a debug object, which * can endup in printk() recursion. */ - uart_port_lock(state, flags); + uport = uart_port_lock(state, flags); xmit_buf = state->xmit.buf; state->xmit.buf = NULL; uart_port_unlock(uport, flags);