Skip to content

Commit

Permalink
serial: tegra: fix tty-kref leak
Browse files Browse the repository at this point in the history
Fix potential tty-kref leak in stop_rx path.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Sep 17, 2013
1 parent 272b98c commit cfd29aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/tty/serial/serial-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ static irqreturn_t tegra_uart_isr(int irq, void *data)
static void tegra_uart_stop_rx(struct uart_port *u)
{
struct tegra_uart_port *tup = to_tegra_uport(u);
struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
struct tty_struct *tty;
struct tty_port *port = &u->state->port;
struct dma_tx_state state;
unsigned long ier;
Expand All @@ -744,6 +744,8 @@ static void tegra_uart_stop_rx(struct uart_port *u)
if (!tup->rx_in_progress)
return;

tty = tty_port_tty_get(&tup->uport.state->port);

tegra_uart_wait_sym_time(tup, 1); /* wait a character interval */

ier = tup->ier_shadow;
Expand Down

0 comments on commit cfd29aa

Please sign in to comment.