diff options
author | Dandan Bi <dandan.bi@intel.com> | 2019-05-27 19:25:09 -0700 |
---|---|---|
committer | Jaben Carsey <jaben.carsey@intel.com> | 2019-06-12 09:23:30 -0700 |
commit | fc7d997c35372126823c3b0acf7b67c45cbeea36 (patch) | |
tree | dbd3ffa57ab787dee62d331c5f877509f4d1d819 /ShellPkg | |
parent | 4eb0acb1e2bef27d29ed8cc6200a9963b5cb0565 (diff) | |
download | edk2-fc7d997c35372126823c3b0acf7b67c45cbeea36.tar.gz edk2-fc7d997c35372126823c3b0acf7b67c45cbeea36.tar.bz2 edk2-fc7d997c35372126823c3b0acf7b67c45cbeea36.zip |
ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1498
This patch fix following bugs in func DisplaySysEventLogData:
1. Log increment (Log = (LOG_RECORD_FORMAT *) (LogData + Offset);)
should happened in the end of while loop, not in the very beginning.
2. DisplaySELTypes function should be used in while loop instead of
DisplaySELVarDataFormatType.
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c index b8adf438d3..984c178890 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c @@ -1,7 +1,7 @@ /** @file
Module for clarifying the content of the smbios structure element info.
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -347,16 +347,12 @@ DisplaySysEventLogData ( Offset = 0;
Log = (LOG_RECORD_FORMAT *) LogData;
while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {
- //
- // Get a Event Log Record
- //
- Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
if (Log != NULL) {
//
// Display Event Log Record Information
//
- DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL);
+ DisplaySELTypes (Log->Type, SHOW_DETAIL);
DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);
Offset += Log->Length;
@@ -373,6 +369,10 @@ DisplaySysEventLogData ( Print (L"20");
} else {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);
+ //
+ // Get a Event Log Record
+ //
+ Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
continue;
}
@@ -391,11 +391,19 @@ DisplaySysEventLogData ( // Display Variable Data Format
//
if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {
+ //
+ // Get a Event Log Record
+ //
+ Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
continue;
}
ElVdfType = Log->LogVariableData[0];
DisplayElVdfInfo (ElVdfType, Log->LogVariableData);
+ //
+ // Get a Event Log Record
+ //
+ Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
}
}
}
|