]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
MdeModulePkg: Add the alignment check for FTW spare area address and length, and...
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / VariableDxe.c
index a697ae1c3a39414ab3600ff53aa5e005673a9cb6..c02d637699ab6aacc04ffe8ac1eaa9884ad51e93 100644 (file)
@@ -335,6 +335,7 @@ FtwNotificationEvent (
   UINT64                                  Length;\r
   EFI_PHYSICAL_ADDRESS                    VariableStoreBase;\r
   UINT64                                  VariableStoreLength;\r
   UINT64                                  Length;\r
   EFI_PHYSICAL_ADDRESS                    VariableStoreBase;\r
   UINT64                                  VariableStoreLength;\r
+  UINTN                                   FtwMaxBlockSize;\r
 \r
   //\r
   // Ensure FTW protocol is installed.\r
 \r
   //\r
   // Ensure FTW protocol is installed.\r
@@ -343,7 +344,12 @@ FtwNotificationEvent (
   if (EFI_ERROR (Status)) {\r
     return ;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return ;\r
   }\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
   //\r
   // Find the proper FVB protocol for variable.\r
   //\r