When disabling, a SRB may be comprised of requests that have been
prepared and completed. Set the SrbStatus as early as possible, so
that any partially completed SRB is always failed.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
SrbExt = Request->SrbExt;
Srb = SrbExt->Srb;
+ Srb->SrbStatus = SRB_STATUS_ABORTED;
+ Srb->ScsiStatus = 0x40; // SCSI_ABORTED
+
RingPutRequest(Ring, Request);
- if (InterlockedDecrement(&SrbExt->RequestCount) == 0) {
- Srb->SrbStatus = SRB_STATUS_ABORTED;
- Srb->ScsiStatus = 0x40; // SCSI_ABORTED
+ if (InterlockedDecrement(&SrbExt->RequestCount) == 0)
AdapterCompleteSrb(Adapter, SrbExt);
- }
}
}