summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/serial-tegra.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-09-10 12:50:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 10:05:47 -0700
commitcfd29aa0e81b791985e8428e6507e80e074e6730 (patch)
tree865ba3ca6cb117d0e86f8e2ac13e038b2cf2e725 /drivers/tty/serial/serial-tegra.c
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
downloadlinux-cfd29aa0e81b791985e8428e6507e80e074e6730.tar.gz
linux-cfd29aa0e81b791985e8428e6507e80e074e6730.tar.bz2
linux-cfd29aa0e81b791985e8428e6507e80e074e6730.zip
serial: tegra: fix tty-kref leak
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>
Diffstat (limited to 'drivers/tty/serial/serial-tegra.c')
-rw-r--r--drivers/tty/serial/serial-tegra.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index d0d972f7e43e..0489a2bdcdf9 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -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;
@@ -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;