Skip to content

Commit

Permalink
StandaloneMmPkg/MmIpl: Correct FV HOB check founction
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
hongbin123 authored and mergify[bot] committed Jan 13, 2025
1 parent 3c8f47b commit 8c180ac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,24 +823,21 @@ IsFvHobExist (
)
{
EFI_PEI_HOB_POINTERS Hob;
UINTN HobLength;

if ((HobList == NULL) || (HobSize == 0)) {
return FALSE;
}

Hob.Raw = (UINT8 *)HobList;
HobLength = GET_HOB_LENGTH (Hob);
//
// Parse the HOB list until end of list or matching type is found.
//
while (HobLength <= HobSize) {
Hob.Raw = HobList;
while ((UINTN)(Hob.Raw - HobList) < HobSize) {
if (Hob.Header->HobType == EFI_HOB_TYPE_FV) {
return TRUE;
}

Hob.Raw = GET_NEXT_HOB (Hob);
HobLength += GET_HOB_LENGTH (Hob);
Hob.Raw = GET_NEXT_HOB (Hob);
}

return FALSE;
Expand Down

0 comments on commit 8c180ac

Please sign in to comment.