X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FSmmMemLib%2FSmmMemLib.c;h=3987af1eba6ad07848e506e985afffc093113241;hp=3409ddf87c8d4d88af98a0b3cfbeaf070085f375;hb=264914a512f06916aae0e5c292d1f9676ddbbb3d;hpb=6809627276640a0c57b3f3c7cf0c5eb469f019e6 diff --git a/MdePkg/Library/SmmMemLib/SmmMemLib.c b/MdePkg/Library/SmmMemLib/SmmMemLib.c index 3409ddf87c..3987af1eba 100644 --- a/MdePkg/Library/SmmMemLib/SmmMemLib.c +++ b/MdePkg/Library/SmmMemLib/SmmMemLib.c @@ -439,7 +439,7 @@ SmmMemLibInternalGetUefiMemoryAttributesTable ( UINTN MemoryAttributesTableSize; Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID **)&MemoryAttributesTable); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR (Status) && (MemoryAttributesTable != NULL)) { MemoryAttributesTableSize = sizeof(EFI_MEMORY_ATTRIBUTES_TABLE) + MemoryAttributesTable->DescriptorSize * MemoryAttributesTable->NumberOfEntries; mSmmMemLibMemoryAttributesTable = AllocateCopyPool (MemoryAttributesTableSize, MemoryAttributesTable); ASSERT (mSmmMemLibMemoryAttributesTable != NULL);