https://git.reactos.org/?p=reactos.git;a=commitdiff;h=900b6a5d56bf7b1106216…
commit 900b6a5d56bf7b1106216ec45f8a6b036530fbd2
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu Jun 17 15:07:39 2021 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon Jun 28 10:20:57 2021 +0200
[FREELDR] Check HwInterrupt return value
_Must_inspect_result_ is there for a reason
CORE-17637
---
boot/freeldr/freeldr/disk/scsiport.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/boot/freeldr/freeldr/disk/scsiport.c b/boot/freeldr/freeldr/disk/scsiport.c
index c9cff4bfd60..d23fe58a76e 100644
--- a/boot/freeldr/freeldr/disk/scsiport.c
+++ b/boot/freeldr/freeldr/disk/scsiport.c
@@ -139,7 +139,11 @@ SpiSendSynchronousSrb(
while (!(DeviceExtension->InterruptFlags & SCSI_PORT_NEXT_REQUEST_READY))
{
KeStallExecutionProcessor(100 * 1000);
- DeviceExtension->HwInterrupt(DeviceExtension->MiniPortDeviceExtension);
+ if
(!DeviceExtension->HwInterrupt(DeviceExtension->MiniPortDeviceExtension))
+ {
+ ExFreePool(Srb);
+ return FALSE;
+ }
}
DeviceExtension->InterruptFlags &= ~SCSI_PORT_NEXT_REQUEST_READY;
@@ -157,7 +161,11 @@ SpiSendSynchronousSrb(
while (Srb->SrbFlags & SRB_FLAGS_IS_ACTIVE)
{
KeStallExecutionProcessor(100 * 1000);
- DeviceExtension->HwInterrupt(DeviceExtension->MiniPortDeviceExtension);
+ if
(!DeviceExtension->HwInterrupt(DeviceExtension->MiniPortDeviceExtension))
+ {
+ ExFreePool(Srb);
+ return FALSE;
+ }
}
ret = SRB_STATUS(Srb->SrbStatus) == SRB_STATUS_SUCCESS;