aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 15df633521d0..43a23286d6fe 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1125,8 +1125,10 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
1125 qc->private_data = &wait; 1125 qc->private_data = &wait;
1126 qc->complete_fn = ata_qc_complete_internal; 1126 qc->complete_fn = ata_qc_complete_internal;
1127 1127
1128 if (ata_qc_issue(qc)) 1128 if (ata_qc_issue(qc)) {
1129 goto issue_fail; 1129 qc->err_mask = AC_ERR_OTHER;
1130 ata_qc_complete(qc);
1131 }
1130 1132
1131 spin_unlock_irqrestore(&ap->host_set->lock, flags); 1133 spin_unlock_irqrestore(&ap->host_set->lock, flags);
1132 1134
@@ -1155,11 +1157,6 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
1155 ata_qc_free(qc); 1157 ata_qc_free(qc);
1156 1158
1157 return err_mask; 1159 return err_mask;
1158
1159 issue_fail:
1160 ata_qc_free(qc);
1161 spin_unlock_irqrestore(&ap->host_set->lock, flags);
1162 return AC_ERR_OTHER;
1163} 1160}
1164 1161
1165/** 1162/**
@@ -3687,10 +3684,10 @@ int ata_qc_issue(struct ata_queued_cmd *qc)
3687 if (ata_should_dma_map(qc)) { 3684 if (ata_should_dma_map(qc)) {
3688 if (qc->flags & ATA_QCFLAG_SG) { 3685 if (qc->flags & ATA_QCFLAG_SG) {
3689 if (ata_sg_setup(qc)) 3686 if (ata_sg_setup(qc))
3690 goto err_out; 3687 goto sg_err;
3691 } else if (qc->flags & ATA_QCFLAG_SINGLE) { 3688 } else if (qc->flags & ATA_QCFLAG_SINGLE) {
3692 if (ata_sg_setup_one(qc)) 3689 if (ata_sg_setup_one(qc))
3693 goto err_out; 3690 goto sg_err;
3694 } 3691 }
3695 } else { 3692 } else {
3696 qc->flags &= ~ATA_QCFLAG_DMAMAP; 3693 qc->flags &= ~ATA_QCFLAG_DMAMAP;
@@ -3703,7 +3700,8 @@ int ata_qc_issue(struct ata_queued_cmd *qc)
3703 3700
3704 return ap->ops->qc_issue(qc); 3701 return ap->ops->qc_issue(qc);
3705 3702
3706err_out: 3703sg_err:
3704 qc->flags &= ~ATA_QCFLAG_DMAMAP;
3707 return -1; 3705 return -1;
3708} 3706}
3709 3707