Skip to content
Commit 3216c622 authored by Stefan Agner's avatar Stefan Agner Committed by Greg Kroah-Hartman
Browse files

tty: serial: lpuart: avoid leaking struct tty_struct

The function tty_port_tty_get() gets a reference to the tty. Since
the code is not using tty_port_tty_set(), the reference is kept
even after closing the tty.

Avoid using tty_port_tty_get() by directly access the tty instance.
Since lpuart_start_rx_dma() is called from the .startup() and
.set_termios() callback, it is safe to assume the tty instance is
valid.

Cc: stable@vger.kernel.org # v4.9+
Fixes: 5887ad43

 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx")
Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0bf2d49
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment