summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-11 01:41:28 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-11 01:41:28 +0000
commit31abeada42ff7f265e42cdea7c44ea44d16568b9 (patch)
tree79f7157d7ffa860b7b1ac9067da6225263c0f7ce /MdeModulePkg
parent240bc4ee8fdd73054b6dd58547ef416b9d9e2a7f (diff)
downloadedk2-platforms-31abeada42ff7f265e42cdea7c44ea44d16568b9.tar.xz
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 <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13305 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c42
1 files 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 ++;
}