]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg MemoryProfile: Add ASSERTs to make sure pointers are not NULL
authorHao Wu <hao.a.wu@intel.com>
Mon, 4 Jul 2016 04:38:28 +0000 (12:38 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 5 Jul 2016 05:31:41 +0000 (13:31 +0800)
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>
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c

index 14c4959f9fe220857cf7640be6e0ab0fc18ef275..30c0df46d682560e1a6cd498aebea3034e86e2df 100644 (file)
@@ -1283,6 +1283,9 @@ CoreUpdateProfileFree (
       }\r
     }\r
 \r
+    ASSERT (DriverInfoData != NULL);\r
+    ASSERT (AllocInfoData != NULL);\r
+\r
     Found = TRUE;\r
 \r
     Context = &ContextData->Context;\r
index 281e382d5c8102af3c0a512fc8d732c828a89717..ac832ce38c740c096459f6914f9a35a760088d24 100644 (file)
@@ -1403,6 +1403,9 @@ SmmCoreUpdateProfileFree (
       }\r
     }\r
 \r
+    ASSERT (DriverInfoData != NULL);\r
+    ASSERT (AllocInfoData != NULL);\r
+\r
     Found = TRUE;\r
 \r
     Context = &ContextData->Context;\r