summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2017-09-26 10:43:42 +0800
committerEric Dong <eric.dong@intel.com>2017-09-27 11:15:29 +0800
commit3dcb53258df3d3f7deb9ef4083fdb5b7aa9e22b3 (patch)
tree0f979a52bf6ca359637cdb3dd80e051ba4ffee89 /UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
parentcbd7300c802d4a855991c041527d621717a984d2 (diff)
downloadedk2-3dcb53258df3d3f7deb9ef4083fdb5b7aa9e22b3.tar.gz
edk2-3dcb53258df3d3f7deb9ef4083fdb5b7aa9e22b3.tar.bz2
edk2-3dcb53258df3d3f7deb9ef4083fdb5b7aa9e22b3.zip
UefiCpuPkg/CpuCommonFeaturesLib: Add check for input parameter.
The ConfigData parameter initialized in *GetConfigData function should not be NULL in later *Support, *Initilize function, so just add ASSERT code check in these functions. Cc: Ming Shao <ming.shao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c')
-rw-r--r--UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
index 8a12080cfb..b42f5de2e3 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
@@ -120,6 +120,7 @@ ProcTraceSupport (
// Check if ProcTraceMemorySize option is enabled (0xFF means disable by user)
//
ProcTraceData = (PROC_TRACE_DATA *) ConfigData;
+ ASSERT (ProcTraceData != NULL);
if ((ProcTraceData->ProcTraceMemSize > RtitTopaMemorySize128M) ||
(ProcTraceData->ProcTraceOutputScheme > RtitOutputSchemeToPA)) {
return FALSE;
@@ -191,6 +192,7 @@ ProcTraceInitialize (
RTIT_TOPA_TABLE_ENTRY *TopaEntryPtr;
ProcTraceData = (PROC_TRACE_DATA *) ConfigData;
+ ASSERT (ProcTraceData != NULL);
MemRegionBaseAddr = 0;
FirstIn = FALSE;