diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c index 7a1470bd36..396618b057 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c @@ -272,6 +272,7 @@ RegisterCpuFeatureWorker ( ASSERT (CpuFeaturesData->BitMaskSize == BitMaskSize); FeatureExist = FALSE; + CpuFeatureEntry = NULL; Entry = GetFirstNode (&CpuFeaturesData->FeatureList); while (!IsNull (&CpuFeaturesData->FeatureList, Entry)) { CpuFeatureEntry = CPU_FEATURE_ENTRY_FROM_LINK (Entry); @@ -293,6 +294,7 @@ RegisterCpuFeatureWorker ( } else { DEBUG ((DEBUG_INFO, "[OVERRIDE] ")); DumpCpuFeature (CpuFeature); + ASSERT (CpuFeatureEntry != NULL); // // Overwrite original parameters of CPU feature //