summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-09-10 14:50:50 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 21:05:47 +0400
commit19b85cfb190eb9980eaf416bff96aef4159a430e (patch)
tree16a8a2a12c75644042ca8969b2cdcac9dccae77c /drivers/tty
parentfc0919c68cb2f75bb1af759315f9d7e2a9443c28 (diff)
downloadlinux-19b85cfb190eb9980eaf416bff96aef4159a430e.tar.xz
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')
-rw-r--r--drivers/tty/serial/pch_uart.c3
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;