summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-07-04 12:38:28 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-05 13:31:41 +0800
commit9cda0af7ecfcfc5446da13e63b1930a0d83c0f3f (patch)
tree4f4ba7deb5335c5e10a9ae81ffc8ea1de36c338c /MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
parent6f9760d88b11d3a848c2522286f3a5b5e5214fbd (diff)
downloadedk2-9cda0af7ecfcfc5446da13e63b1930a0d83c0f3f.tar.gz
edk2-9cda0af7ecfcfc5446da13e63b1930a0d83c0f3f.tar.bz2
edk2-9cda0af7ecfcfc5446da13e63b1930a0d83c0f3f.zip
MdeModulePkg MemoryProfile: Add ASSERTs to make sure pointers are not NULL
Code logic ensures that both pointers 'DriverInfoData' and 'AllocInfoData' will not be NULL when they are used. Add ASSERTs as warning for cases that will not happen. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c')
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 14c4959f9f..30c0df46d6 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -1283,6 +1283,9 @@ CoreUpdateProfileFree (
}
}
+ ASSERT (DriverInfoData != NULL);
+ ASSERT (AllocInfoData != NULL);
+
Found = TRUE;
Context = &ContextData->Context;