[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>
This commit is contained in:
Tejun Heo
2006-01-23 13:09:36 +09:00
committed by Jeff Garzik
parent 77853bf2b4
commit 8e436af932
2 changed files with 12 additions and 12 deletions

View File

@@ -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;