From: Geert Uytterhoeven Date: Fri, 21 Aug 2015 18:02:43 +0000 (+0200) Subject: serial: sh-sci: Fix TX buffer mapping leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2e301474f15f00b3f2ccde85f6f19b17ec7ee70d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git serial: sh-sci: Fix TX buffer mapping leak The mapped transmit buffer is never unmapped. This leaks quite some mappings, as the mapping is done in uart_ops.startup(), i.e. every time the device is opened. Unmap the buffer on device close. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 5a528b898505..4345aa422eed 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1384,6 +1384,8 @@ static void sci_tx_dma_release(struct sci_port *s, bool enable_pio) s->chan_tx = NULL; s->cookie_tx = -EINVAL; + dma_unmap_single(chan->device->dev, s->tx_dma_addr, UART_XMIT_SIZE, + DMA_TO_DEVICE); dma_release_channel(chan); if (enable_pio) sci_start_tx(port);