Skip to content

Commit e8914b5

Browse files
ij-intelgregkh
authored andcommitted
serial: pch_uart: Pass correct sg to dma_unmap_sg()
A local variable sg is used to store scatterlist pointer in pch_dma_tx_complete(). The for loop doing Tx byte accounting before dma_unmap_sg() alters sg in its increment statement. Therefore, the pointer passed into dma_unmap_sg() won't match to the one given to dma_map_sg(). To fix the problem, use priv->sg_tx_p directly in dma_unmap_sg() instead of the local variable. Fixes: da3564e ("pch_uart: add multi-scatter processing") Cc: stable@vger.kernel.org Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230103093435.4396-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b8caf69 commit e8914b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/pch_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ static void pch_dma_tx_complete(void *arg)
749749
uart_xmit_advance(port, sg_dma_len(sg));
750750

751751
async_tx_ack(priv->desc_tx);
752-
dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE);
752+
dma_unmap_sg(port->dev, priv->sg_tx_p, priv->orig_nent, DMA_TO_DEVICE);
753753
priv->tx_dma_use = 0;
754754
priv->nent = 0;
755755
priv->orig_nent = 0;

0 commit comments

Comments
 (0)