Commit ff09b71b authored by Thomas Fourier's avatar Thomas Fourier Committed by Ulf Hansson
Browse files

mmc: bcm2835: Fix dma_unmap_sg() nents value



The dma_unmap_sg() functions should be called with the same nents as the
dma_map_sg(), not the value the map function returned.

Fixes: 2f5da678 ("mmc: bcm2835: Properly handle dmaengine_prep_slave_sg")
Signed-off-by: default avatarThomas Fourier <fourier.thomas@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250630093510.82871-2-fourier.thomas@gmail.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 6d0b1c01
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -503,7 +503,8 @@ void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data)
				       DMA_PREP_INTERRUPT | DMA_CTRL_ACK);

	if (!desc) {
		dma_unmap_sg(dma_chan->device->dev, data->sg, sg_len, dir_data);
		dma_unmap_sg(dma_chan->device->dev, data->sg, data->sg_len,
			     dir_data);
		return;
	}