summaryrefslogtreecommitdiff
path: root/MdeModulePkg
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 08:53:18 +0800
commitd8162f5b3283a06a6dc4e2e05cd0c45fc4358eb0 (patch)
tree595878c17ab15ffce81c08cca59eec086dc889ce /MdeModulePkg
parente895641ba9a8818d2694d30f42644356c022c2c4 (diff)
downloadedk2-platforms-d8162f5b3283a06a6dc4e2e05cd0c45fc4358eb0.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>
Diffstat (limited to 'MdeModulePkg')
-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 30c0df46d6..b67a17c86d 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -442,6 +442,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 ac832ce38c..93585f199d 100644
--- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
+++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c
@@ -443,6 +443,7 @@ BuildDriverInfo (
if (EFI_ERROR (Status)) {
return NULL;
}
+ ASSERT (DriverInfoData != NULL);
ZeroMem (DriverInfoData, sizeof (*DriverInfoData));