]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableDxe.c
Fix the return value bug when updating public key database variable failure.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / RuntimeDxe / VariableDxe.c
index ef53a96144de0a37f0158332438538cc0bd03545..949fb64248bf99acdab98e8924e43ec0402122dc 100644 (file)
@@ -3,7 +3,7 @@
   and volatile storage space and install variable architecture protocol.\r
 \r
 Copyright (C) 2013, Red Hat, Inc.\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -241,7 +241,6 @@ VariableClassAddressChangeEvent (
   EfiConvertPointer (0x0, (VOID **) &mVariableModuleGlobal->VariableGlobal.VolatileVariableBase);\r
   EfiConvertPointer (0x0, (VOID **) &mVariableModuleGlobal);\r
   EfiConvertPointer (0x0, (VOID **) &mHashCtx);\r
-  EfiConvertPointer (0x0, (VOID **) &mStorageArea);\r
   EfiConvertPointer (0x0, (VOID **) &mSerializationRuntimeBuffer);\r
   EfiConvertPointer (0x0, (VOID **) &mNvVariableCache);\r
 \r
@@ -337,6 +336,7 @@ FtwNotificationEvent (
   UINT64                                  Length;\r
   EFI_PHYSICAL_ADDRESS                    VariableStoreBase;\r
   UINT64                                  VariableStoreLength;\r
+  UINTN                                   FtwMaxBlockSize;\r
 \r
   //\r
   // Ensure FTW protocol is installed.\r
@@ -346,6 +346,11 @@ FtwNotificationEvent (
     return ;\r
   }\r
 \r
+  Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize);\r
+  if (!EFI_ERROR (Status)) {\r
+    ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize);\r
+  }\r
+\r
   //\r
   // Find the proper FVB protocol for variable.\r
   //\r
@@ -383,7 +388,9 @@ FtwNotificationEvent (
   }\r
 \r
   Status = VariableWriteServiceInitialize ();\r
-  ASSERT_EFI_ERROR (Status);\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((DEBUG_ERROR, "Variable write service initialization failed. Status = %r\n", Status));\r
+  }\r
 \r
   //\r
   // Install the Variable Write Architectural protocol.\r