summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-07-07 08:49:38 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-12 09:22:51 +0800
commitbab57374fb8237add3c51b37b81daa7c631660ef (patch)
tree8ee77f7f66e44e31a1efde6c16ef47238215a353
parent19c2ab1a5fc90eb20c5ef0a0a68adf7ba400662c (diff)
downloadedk2-platforms-bab57374fb8237add3c51b37b81daa7c631660ef.tar.xz
MdeModulePkg MemoryProfile: ASSERT to ensure 'DriverInfoData' is not NULL
Code logic ensures that the pointer 'DriverInfoData' will not be NULL when it is used. Add ASSERT as warning for case 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> (cherry picked from commit d8162f5b3283a06a6dc4e2e05cd0c45fc4358eb0)
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c1
-rw-r--r--MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 1f17947808..7141373fd5 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -319,6 +319,7 @@ BuildDriverInfo (
if (EFI_ERROR (Status)) {
return NULL;
}
+ ASSERT (DriverInfoData != NULL);
ZeroMem (DriverInfoData, sizeof (*DriverInfoData));
diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
index 57b34a018d..51fa7f947d 100644
--- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
+++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
@@ -272,6 +272,7 @@ BuildDriverInfo (
if (EFI_ERROR (Status)) {
return NULL;
}
+ ASSERT (DriverInfoData != NULL);
ZeroMem (DriverInfoData, sizeof (*DriverInfoData));