Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e301474 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Greg Kroah-Hartman
Browse files

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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79904420
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1384,6 +1384,8 @@ static void sci_tx_dma_release(struct sci_port *s, bool enable_pio)


	s->chan_tx = NULL;
	s->chan_tx = NULL;
	s->cookie_tx = -EINVAL;
	s->cookie_tx = -EINVAL;
	dma_unmap_single(chan->device->dev, s->tx_dma_addr, UART_XMIT_SIZE,
			 DMA_TO_DEVICE);
	dma_release_channel(chan);
	dma_release_channel(chan);
	if (enable_pio)
	if (enable_pio)
		sci_start_tx(port);
		sci_start_tx(port);