diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 07abe4bf8b..4ddcca208a 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -1580,7 +1580,7 @@ CollectBistDataFromHob ( } } - while (NumberOfData--) { + while ((NumberOfData--) > 0) { for (ProcessorNumber = 0; ProcessorNumber < mMpSystemData.NumberOfProcessors; ProcessorNumber++) { CpuData = &mMpSystemData.CpuDatas[ProcessorNumber]; InitialLocalApicId = (UINT32) CpuData->Info.ProcessorId;