[ivshmem] prevent potential result code overwrite
@@ -180,14 +180,16 @@ NTSTATUS IVSHMEMEvtDevicePrepareHardware(_In_ WDFDEVICE Device, _In_ WDFCMRESLIS
}
}
- if (memIndex == 0)
- result = STATUS_DEVICE_HARDWARE_ERROR;
-
if (NT_SUCCESS(result))
+ {
+ if (!deviceContext->shmemMDL)
+ result = STATUS_DEVICE_HARDWARE_ERROR;
+ else
{
DEBUG_INFO("Shared Memory: %p, %u bytes", deviceContext->shmemAddr.PhysicalAddress, deviceContext->shmemAddr.NumberOfBytes);
DEBUG_INFO("Interrupts : %d", deviceContext->interruptsUsed);
}
+ }
return result;
}
