MdeModulePkg MemoryProfile: ASSERT to ensure 'DriverInfoData' is not NULL
authorHao Wu <hao.a.wu@intel.com>
Thu, 7 Jul 2016 00:49:38 +0000 (08:49 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 12 Jul 2016 00:53:18 +0000 (08:53 +0800)
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>
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c

index 30c0df4..b67a17c 100644 (file)
@@ -442,6 +442,7 @@ BuildDriverInfo (
   if (EFI_ERROR (Status)) {\r
     return NULL;\r
   }\r
+  ASSERT (DriverInfoData != NULL);\r
 \r
   ZeroMem (DriverInfoData, sizeof (*DriverInfoData));\r
 \r
index ac832ce..93585f1 100644 (file)
@@ -443,6 +443,7 @@ BuildDriverInfo (
   if (EFI_ERROR (Status)) {\r
     return NULL;\r
   }\r
+  ASSERT (DriverInfoData != NULL);\r
 \r
   ZeroMem (DriverInfoData, sizeof (*DriverInfoData));\r
 \r