SourceLevelDebugPkg/SmmDebugAgent: mMailboxPointer is used before set

mMailboxPointer is used before it is initialization. This issue only happens
when SmmDebugAgent is initialized without PeiDebugAgent or DxeDebugAgent
initialization. The fix is to use Mailbox instead.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Jeff Fan 2016-04-01 12:53:06 +08:00
parent de70b8c51b
commit f3ee38dd95
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file
Debug Agent library implementition.
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -243,7 +243,7 @@ InitializeDebugAgent (
// Initialize Debug Timer hardware and save its frequency
//
InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
DebugPortHandle = (UINT64) (UINTN)DebugPortInitialize ((DEBUG_PORT_HANDLE) (UINTN)Mailbox->DebugPortHandle, NULL);
UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_PORT_HANDLE_INDEX, DebugPortHandle);