summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index c0505e2dfc2..d61f9a8cc18 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -570,8 +570,12 @@ int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd)
if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
(dma_ops->dma_check && dma_ops->dma_check(drive, cmd)) ||
- ide_build_sglist(drive, cmd) == 0 ||
- dma_ops->dma_setup(drive, cmd))
+ ide_build_sglist(drive, cmd) == 0)
return 1;
+ if (dma_ops->dma_setup(drive, cmd)) {
+ ide_destroy_dmatable(drive);
+ ide_map_sg(drive, cmd);
+ return 1;
+ }
return 0;
}