]> git.proxmox.com Git - mirror_edk2.git/commitdiff
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 30c0df46d682560e1a6cd498aebea3034e86e2df..b67a17c86dff22e5c410dbadc816d6dbf0e52cc4 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 ac832ce38c740c096459f6914f9a35a760088d24..93585f199df9a5ca67d05258ef805fdce01c3069 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