https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b08990352040447fc4cb9…
commit b08990352040447fc4cb9b6a6e1978a8a24c08d6
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Wed Dec 9 12:40:51 2020 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Dec 9 12:40:51 2020 +0100
[SCSIPORT] Addendum to 58ad5d9e02bbb08c3229ee06ed25f64e13c2a2f0
---
drivers/storage/port/scsiport/scsi.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/storage/port/scsiport/scsi.c b/drivers/storage/port/scsiport/scsi.c
index 0aa7d36a3d5..056e2bb8328 100644
--- a/drivers/storage/port/scsiport/scsi.c
+++ b/drivers/storage/port/scsiport/scsi.c
@@ -400,7 +400,10 @@ SpiGetNextRequestFromLun(
else
{
/* Release the spinlock, without clearing any flags and exit */
- KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock);
+ if (OldIrql != NULL)
+ KeReleaseSpinLock(&DeviceExtension->SpinLock, *OldIrql);
+ else
+ KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock);
return;
}
@@ -429,7 +432,10 @@ SpiGetNextRequestFromLun(
LunExtension->SortKey++;
/* Release the spinlock */
- KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock);
+ if (OldIrql != NULL)
+ KeReleaseSpinLock(&DeviceExtension->SpinLock, *OldIrql);
+ else
+ KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock);
/* Start the next pending request */
IoStartPacket(DeviceExtension->Common.DeviceObject, NextIrp, (PULONG)NULL,
NULL);
@@ -437,7 +443,10 @@ SpiGetNextRequestFromLun(
else
{
/* Release the spinlock */
- KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock);
+ if (OldIrql != NULL)
+ KeReleaseSpinLock(&DeviceExtension->SpinLock, *OldIrql);
+ else
+ KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock);
}
}