Skip to content

Commit 8c180ac

Browse files
hongbin123mergify[bot]
authored andcommitted
StandaloneMmPkg/MmIpl: Correct FV HOB check founction
When at last hob, the FV HOB check function should exit from the loop Signed-off-by: Hongbin1 Zhang <[email protected]> Cc: Jiewen Yao <[email protected]> Cc: Ray Ni <[email protected]> Cc: Star Zeng <[email protected]> Cc: Jiaxin Wu <[email protected]> Cc: Wei6 Xu <[email protected]> Cc: Sami Mujawar <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Supreeth Venkatesh <[email protected]>
1 parent 3c8f47b commit 8c180ac

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -823,24 +823,21 @@ IsFvHobExist (
823823
)
824824
{
825825
EFI_PEI_HOB_POINTERS Hob;
826-
UINTN HobLength;
827826

828827
if ((HobList == NULL) || (HobSize == 0)) {
829828
return FALSE;
830829
}
831830

832-
Hob.Raw = (UINT8 *)HobList;
833-
HobLength = GET_HOB_LENGTH (Hob);
834831
//
835832
// Parse the HOB list until end of list or matching type is found.
836833
//
837-
while (HobLength <= HobSize) {
834+
Hob.Raw = HobList;
835+
while ((UINTN)(Hob.Raw - HobList) < HobSize) {
838836
if (Hob.Header->HobType == EFI_HOB_TYPE_FV) {
839837
return TRUE;
840838
}
841839

842-
Hob.Raw = GET_NEXT_HOB (Hob);
843-
HobLength += GET_HOB_LENGTH (Hob);
840+
Hob.Raw = GET_NEXT_HOB (Hob);
844841
}
845842

846843
return FALSE;

0 commit comments

Comments
 (0)