summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-01-23 05:09:36 +0100
committerJeff Garzik <jgarzik@pobox.com>2006-01-27 04:33:50 +0100
commit8e436af9326f5cc2e07d76505154ffddfb04b485 (patch)
tree26d5a6716ff3c164613811a78e5a06c353d28fe3 /drivers/scsi/libata-scsi.c
parent[PATCH] libata: make the owner of a qc responsible for freeing it (diff)
downloadlinux-8e436af9326f5cc2e07d76505154ffddfb04b485.tar.xz
linux-8e436af9326f5cc2e07d76505154ffddfb04b485.zip
[PATCH] libata: fix ata_qc_issue() error handling
When ata_qc_issue() fails, the qc might have been dma mapped or not. So, performing only ata_qc_free() results in dma map leak. This patch makes ata_qc_issue() mark dma map flags correctly on failure and calls ata_qc_complete() after ata_qc_issue() fails. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index ce3fe928a386..c496309f691a 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -1322,8 +1322,10 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
goto early_finish;
/* select device, send command to hardware */
- if (ata_qc_issue(qc))
- goto err_did;
+ if (ata_qc_issue(qc)) {
+ qc->err_mask |= AC_ERR_OTHER;
+ ata_qc_complete(qc);
+ }
VPRINTK("EXIT\n");
return;