Skip to content

Commit

Permalink
[PATCH] libata: fix ata_qc_issue failure path
Browse files Browse the repository at this point in the history
On sg_err failure path, ata_qc_issue() doesn't mark the qc active
before returning.  This triggers WARN_ON() in __ata_qc_complete() when
the qc gets completed.  This patch moves ap->active_tag and
QCFLAG_ACTIVE setting to the top of the function.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 31, 2006
1 parent 79ea24e commit e4a70e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4006,6 +4006,9 @@ unsigned int ata_qc_issue(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc->ap;

qc->ap->active_tag = qc->tag;
qc->flags |= ATA_QCFLAG_ACTIVE;

if (ata_should_dma_map(qc)) {
if (qc->flags & ATA_QCFLAG_SG) {
if (ata_sg_setup(qc))
Expand All @@ -4020,9 +4023,6 @@ unsigned int ata_qc_issue(struct ata_queued_cmd *qc)

ap->ops->qc_prep(qc);

qc->ap->active_tag = qc->tag;
qc->flags |= ATA_QCFLAG_ACTIVE;

return ap->ops->qc_issue(qc);

sg_err:
Expand Down

0 comments on commit e4a70e7

Please sign in to comment.