fix debug print error level hob not save correct debugprinterrorlevel

should cover the case:

Header.Lenth ==UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD ()

Change-Id: Ibebe29fe8057e24448b31a8caa7ab6eb8054c39b
BugZilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4264
Signed-off-by: Ning Feng <ning.f...@intel.com>
---
 .../DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
index 4f6b4ef1fb..10bdbe2bbc 100644
--- 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
+++ 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
@@ -46,7 +46,7 @@ GetDebugPrintErrorLevel (
       {
         if (GenericHeader->Revision == 
UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) {
           DebugPrintErrorLevel =  (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL 
*)GET_GUID_HOB_DATA (GuidHob);
-          if (DebugPrintErrorLevel->Header.Length > 
UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, 
ErrorLevel)) {
+          if (DebugPrintErrorLevel->Header.Length >= 
UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, 
ErrorLevel)) {
             gDebugPrintErrorLevel = DebugPrintErrorLevel->ErrorLevel;
           }
         }
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98099): https://edk2.groups.io/g/devel/message/98099
Mute This Topic: https://groups.io/mt/96090853/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to