MdeModulePkg/NonDiscoverablePciDeviceDxe: Add NULL pointer check

Add check for NULL HostAddress in AllocateBuffer as required by UEFI
specification.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Jeff Brasen 2020-09-12 01:16:30 +08:00 committed by mergify[bot]
parent b5701a4c7a
commit 698d3d7726
1 changed files with 4 additions and 0 deletions

View File

@ -856,6 +856,10 @@ CoherentPciIoAllocateBuffer (
return EFI_UNSUPPORTED;
}
if (HostAddress == NULL) {
return EFI_INVALID_PARAMETER;
}
if ((MemoryType != EfiBootServicesData) &&
(MemoryType != EfiRuntimeServicesData)) {
return EFI_INVALID_PARAMETER;