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

Signed-off-by: Jeff Brasen <jbra...@nvidia.com>
---
 .../NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c  | 4 ++++
 1 file changed, 4 insertions(+)

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;

-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#65193): https://edk2.groups.io/g/devel/message/65193
Mute This Topic: https://groups.io/mt/76784482/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to