From d73196f3298bebecfa6c81b25e7548d188e08c56 Mon Sep 17 00:00:00 2001 From: dtang2 Date: Thu, 2 Nov 2006 07:24:49 +0000 Subject: [PATCH] Bug fix for "CapsuleUpdate does not handle memory lost correctly" git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1886 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/Capsule/RuntimeDxe/CapsuleService.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EdkModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c b/EdkModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c index e07cbc8ab0..9f4fe3c061 100644 --- a/EdkModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c +++ b/EdkModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c @@ -75,11 +75,11 @@ Returns: // for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) { CapsuleHeader = CapsuleHeaderArray[ArrayNumber]; - if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) && !(CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET)) { + if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) { return EFI_INVALID_PARAMETER; } if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &mEfiCapsuleHeaderGuid)) { - if (!(CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) { + if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) { return EFI_UNSUPPORTED; } } @@ -206,11 +206,11 @@ Returns: // for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) { CapsuleHeader = CapsuleHeaderArray[ArrayNumber]; - if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) && !(CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET)) { + if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) { return EFI_INVALID_PARAMETER; } if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &mEfiCapsuleHeaderGuid)) { - if (!(CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) { + if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) { return EFI_UNSUPPORTED; } }