virtio_scsi: Fix theoretical use of possibly modified fCCB.

As soon as the lock is released, fCCB may change due to a new Start().
With the current use of the request class this could not happen, so
this is purely theoretical.

Change-Id: I6caee7f904f1864621aeef088e2bd611eb3b0a1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1813
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Michael Lotz 2019-09-01 01:51:55 +02:00 committed by waddlesplash
parent 85fbdab0a6
commit 26c0b5e701

View File

@ -126,12 +126,13 @@ VirtioSCSIRequest::Finish(bool resubmit)
}
}
scsi_ccb *ccb = fCCB;
mutex_unlock(&fLock);
if (resubmit)
gSCSI->resubmit(fCCB);
gSCSI->resubmit(ccb);
else
gSCSI->finished(fCCB, 1);
gSCSI->finished(ccb, 1);
TRACE("VirtioSCSIRequest::Finish() done\n");