diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-09-10 12:50:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-17 19:05:47 +0200 |
commit | 19b85cfb190eb9980eaf416bff96aef4159a430e (patch) | |
tree | 16a8a2a12c75644042ca8969b2cdcac9dccae77c /drivers/tty/serial/pch_uart.c | |
parent | serial: pch_uart: fix tty-kref leak in rx-error path (diff) | |
download | linux-19b85cfb190eb9980eaf416bff96aef4159a430e.tar.xz linux-19b85cfb190eb9980eaf416bff96aef4159a430e.zip |
serial: pch_uart: fix tty-kref leak in dma-rx path
Fix tty_kref leak when tty_buffer_request room fails in dma-rx path.
Note that the tty ref isn't really needed anymore, but as the leak has
always been there, fixing it before removing should makes it easier to
backport the fix.
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/pch_uart.c')
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index f0161d6ccc5c..2c5a3e4a17db 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -685,11 +685,12 @@ static int dma_push_rx(struct eg20t_port *priv, int size) dev_warn(port->dev, "Rx overrun: dropping %u bytes\n", size - room); if (!room) - return room; + goto out; tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size); port->icount.rx += room; +out: tty_kref_put(tty); return room; |