Skip to content

Commit 6198bfe

Browse files
Thomas-fouriergregkh
authored andcommitted
mmc: bcm2835: Fix dma_unmap_sg() nents value
commit ff09b71 upstream. 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: 2f5da67 ("mmc: bcm2835: Properly handle dmaengine_prep_slave_sg") Signed-off-by: Thomas Fourier <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a25ebc3 commit 6198bfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mmc/host/bcm2835.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data)
502502
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
503503

504504
if (!desc) {
505-
dma_unmap_sg(dma_chan->device->dev, data->sg, sg_len, dir_data);
505+
dma_unmap_sg(dma_chan->device->dev, data->sg, data->sg_len,
506+
dir_data);
506507
return;
507508
}
508509

0 commit comments

Comments
 (0)