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 <hongbin1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
This commit is contained in:
Hongbin1 Zhang 2025-01-10 21:25:15 +08:00 committed by mergify[bot]
parent 3c8f47bf21
commit 8c180acf1d

View File

@ -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;