summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Core/Dxe/Gcd/Gcd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
index 8bbdf7129f..a76d2db73c 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -1719,7 +1719,7 @@ CoreGetMemorySpaceMap (
// AllocatePool() called below has to be running outside the GCD lock.
//
DescriptorCount = CoreCountGcdMapEntry (&mGcdMemorySpaceMap);
- if (DescriptorCount == *NumberOfDescriptors) {
+ if (DescriptorCount == *NumberOfDescriptors && *MemorySpaceMap != NULL) {
//
// Fill in the MemorySpaceMap if no memory space map change.
//