From 31abeada42ff7f265e42cdea7c44ea44d16568b9 Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Fri, 11 May 2012 01:41:28 +0000 Subject: [PATCH] Currently, CapsulePei assumes ScatterGatherList are all related. But, UEFI spec has no such requirement, ScatterGatherList may be standalone. So update CapsulePei to only ignore the invalid ScatterGatherList, and still keep the valid ScatterGatherList. Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13305 6f19259b-4bc3-4df7-8a09-765794883524 --- .../CapsulePei/Common/CapsuleCoalesce.c | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c index ec6b86f09f..bc8de49dde 100644 --- a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c +++ b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c @@ -720,32 +720,26 @@ BuildCapsuleDescriptors ( Index = 0; while (BlockListBuffer[Index] != 0) { - if (Index == 0) { - // - // For the first Capsule Image, test integrity of descriptors. - // - LastBlock = ValidateCapsuleIntegrity ((EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]); + // + // Test integrity of descriptors. + // + TempBlock = ValidateCapsuleIntegrity ((EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]); + if (TempBlock != NULL) { if (LastBlock == NULL) { - return EFI_NOT_FOUND; - } - // - // Return the base of the block descriptors - // - HeadBlock = (EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]; - } else { - // - // Test integrity of descriptors. - // - TempBlock = ValidateCapsuleIntegrity ((EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]); - if (TempBlock == NULL) { - return EFI_NOT_FOUND; + LastBlock = TempBlock; + + // + // Return the base of the block descriptors + // + HeadBlock = (EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]; + } else { + // + // Combine the different BlockList into single BlockList. + // + LastBlock->Union.DataBlock = (EFI_PHYSICAL_ADDRESS)(UINTN)BlockListBuffer[Index]; + LastBlock->Length = 0; + LastBlock = TempBlock; } - // - // Combine the different BlockList into single BlockList. - // - LastBlock->Union.DataBlock = (EFI_PHYSICAL_ADDRESS)(UINTN)BlockListBuffer[Index]; - LastBlock->Length = 0; - LastBlock = TempBlock; } Index ++; } -- 2.39.2