summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg
diff options
context:
space:
mode:
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>2014-09-28 06:21:46 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-28 06:21:46 +0000
commit8ab6d73c0e240d573cdce317a15317f235d24ac4 (patch)
treec5b3927d94f659acac7748e4041ae729124411aa /EmulatorPkg
parent90be22219668cae514cdb56934cb139089367dae (diff)
downloadedk2-8ab6d73c0e240d573cdce317a15317f235d24ac4.tar.gz
edk2-8ab6d73c0e240d573cdce317a15317f235d24ac4.tar.bz2
edk2-8ab6d73c0e240d573cdce317a15317f235d24ac4.zip
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
Diffstat (limited to 'EmulatorPkg')
-rw-r--r--EmulatorPkg/CpuRuntimeDxe/MpService.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c
index 536a47f7ec..ed57d7a0a3 100644
--- a/EmulatorPkg/CpuRuntimeDxe/MpService.c
+++ b/EmulatorPkg/CpuRuntimeDxe/MpService.c
@@ -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;
}