EmulatorPkg/MpService: Fix a NULL reference

when making a CreateEvent() to call CpuCheckAllAPsStatus(),
the Context parameter was NULL in CpuCheckAllAPsStatus(),
so we must not use the Context as the ProcessorData pointer.
and should recalculate it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16183 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Chen Fan 2014-09-28 06:21:46 +00:00 committed by jljusten
parent 90be222196
commit 8ab6d73c0e
1 changed files with 4 additions and 4 deletions

View File

@ -984,10 +984,9 @@ CpuCheckAllAPsStatus (
gMPSystem.Timeout -= gPollInterval;
}
ProcessorData = (PROCESSOR_DATA_BLOCK *) Context;
for (ProcessorNumber = 0; ProcessorNumber < gMPSystem.NumberOfProcessors; ProcessorNumber++) {
if ((ProcessorData[ProcessorNumber].Info.StatusFlag & PROCESSOR_AS_BSP_BIT) == PROCESSOR_AS_BSP_BIT) {
ProcessorData = &gMPSystem.ProcessorData[ProcessorNumber];
if ((ProcessorData->Info.StatusFlag & PROCESSOR_AS_BSP_BIT) == PROCESSOR_AS_BSP_BIT) {
// Skip BSP
continue;
}
@ -1045,7 +1044,8 @@ CpuCheckAllAPsStatus (
//
if (gMPSystem.FailedList != NULL) {
for (ProcessorNumber = 0; ProcessorNumber < gMPSystem.NumberOfProcessors; ProcessorNumber++) {
if ((ProcessorData[ProcessorNumber].Info.StatusFlag & PROCESSOR_AS_BSP_BIT) == PROCESSOR_AS_BSP_BIT) {
ProcessorData = &gMPSystem.ProcessorData[ProcessorNumber];
if ((ProcessorData->Info.StatusFlag & PROCESSOR_AS_BSP_BIT) == PROCESSOR_AS_BSP_BIT) {
// Skip BSP
continue;
}