qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/7] HACK: HobLib: workaround infinite loop


From: marcandre . lureau
Subject: [Qemu-devel] [PATCH 3/7] HACK: HobLib: workaround infinite loop
Date: Fri, 23 Feb 2018 14:23:07 +0100

From: Marc-André Lureau <address@hidden>

Without this hack, GetNextHob() loops infinitely with the next patch.
I don't understand the reason.

The loop is triggered by the GetFirstGuidHob (&gTpmErrorHobGuid) call.

CC: Laszlo Ersek <address@hidden>
CC: Stefan Berger <address@hidden>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marc-André Lureau <address@hidden>
---
 MdePkg/Library/PeiHobLib/HobLib.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MdePkg/Library/PeiHobLib/HobLib.c 
b/MdePkg/Library/PeiHobLib/HobLib.c
index 5c0eeb992f..ed3c5fbd6d 100644
--- a/MdePkg/Library/PeiHobLib/HobLib.c
+++ b/MdePkg/Library/PeiHobLib/HobLib.c
@@ -89,6 +89,10 @@ GetNextHob (
     if (Hob.Header->HobType == Type) {
       return Hob.Raw;
     }
+    if (GET_HOB_LENGTH (HobStart) == 0) {
+        DEBUG ((DEBUG_INFO, "FIXME: GetNextHob length == 0"));
+        return NULL;
+    }
     Hob.Raw = GET_NEXT_HOB (Hob);
   }
   return NULL;
-- 
2.16.1.73.g5832b7e9f2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]