mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-03 08:04:58 +01:00
mmc: bcm2835: Properly handle dmaengine_prep_slave_sg
In case dmaengine_prep_slave_sg fails we need to call dma_unmap_sg. Signed-off-by: Stefan Wahren <[email protected]> Acked-by: Eric Anholt <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
This commit is contained in:
1 parent
6dc6f26190
commit
2f5da67835
1 file changed
+9
-6
@@ -507,13 +507,16 @@ void bcm2835_prepare_dma(struct bcm2835_host *host, struct mmc_data *data)
|
||||
desc = dmaengine_prep_slave_sg(dma_chan, data->sg, sg_len, dir_slave,
|
||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||
|
||||
if (desc) {
|
||||
desc->callback = bcm2835_dma_complete;
|
||||
desc->callback_param = host;
|
||||
host->dma_desc = desc;
|
||||
host->dma_chan = dma_chan;
|
||||
host->dma_dir = dir_data;
|
||||
if (!desc) {
|
||||
dma_unmap_sg(dma_chan->device->dev, data->sg, sg_len, dir_data);
|
||||
return;
|
||||
}
|
||||
|
||||
desc->callback = bcm2835_dma_complete;
|
||||
desc->callback_param = host;
|
||||
host->dma_desc = desc;
|
||||
host->dma_chan = dma_chan;
|
||||
host->dma_dir = dir_data;
|
||||
}
|
||||
|
||||
static void bcm2835_start_dma(struct bcm2835_host *host)
|
||||
|
||||
Reference in new issue
Block a user