diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c index a40c1a9593..363c4a765b 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c @@ -856,6 +856,10 @@ CoherentPciIoAllocateBuffer ( return EFI_UNSUPPORTED; } + if (HostAddress == NULL) { + return EFI_INVALID_PARAMETER; + } + if ((MemoryType != EfiBootServicesData) && (MemoryType != EfiRuntimeServicesData)) { return EFI_INVALID_PARAMETER;