aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/pch_uart.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-09-10 06:50:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 13:05:47 -0400
commit19b85cfb190eb9980eaf416bff96aef4159a430e (patch)
tree16a8a2a12c75644042ca8969b2cdcac9dccae77c /drivers/tty/serial/pch_uart.c
parentfc0919c68cb2f75bb1af759315f9d7e2a9443c28 (diff)
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.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)
685 dev_warn(port->dev, "Rx overrun: dropping %u bytes\n", 685 dev_warn(port->dev, "Rx overrun: dropping %u bytes\n",
686 size - room); 686 size - room);
687 if (!room) 687 if (!room)
688 return room; 688 goto out;
689 689
690 tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size); 690 tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size);
691 691
692 port->icount.rx += room; 692 port->icount.rx += room;
693out:
693 tty_kref_put(tty); 694 tty_kref_put(tty);
694 695
695 return room; 696 return room;