diff options
author | Jeff Brasen <jbrasen@nvidia.com> | 2020-09-12 01:16:30 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-09-18 02:45:21 +0000 |
commit | 698d3d7726232694018d437279dd4166e462deb7 (patch) | |
tree | b205f29a5268888e86271b9811a529deee80ff17 /MdeModulePkg | |
parent | b5701a4c7a0fb185e0c5b9db9525939c78664bfd (diff) | |
download | edk2-698d3d7726232694018d437279dd4166e462deb7.zip edk2-698d3d7726232694018d437279dd4166e462deb7.tar.gz edk2-698d3d7726232694018d437279dd4166e462deb7.tar.bz2 |
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c index a40c1a9..363c4a7 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;
|