]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg Variable: ###VariableTotalSize need to be initialized to 0 first
authorStar Zeng <star.zeng@intel.com>
Tue, 29 Dec 2015 09:00:58 +0000 (09:00 +0000)
committerlzeng14 <lzeng14@Edk2>
Tue, 29 Dec 2015 09:00:58 +0000 (09:00 +0000)
HwErrVariableTotalSize/CommonVariableTotalSize/CommonUserVariableTotalSize
need to be initialized to 0 first after reclaim failed, then to be assigned by += operation.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19572 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

index 8a07f0ecb6a436ecbe2f6d5c4d83a9f09f19a410..1cb0409e97f450b35b646b4f340ec4bbcd64fd38 100644 (file)
@@ -1191,6 +1191,9 @@ Reclaim (
       mVariableModuleGlobal->CommonVariableTotalSize = CommonVariableTotalSize;\r
       mVariableModuleGlobal->CommonUserVariableTotalSize = CommonUserVariableTotalSize;\r
     } else {\r
+      mVariableModuleGlobal->HwErrVariableTotalSize = 0;\r
+      mVariableModuleGlobal->CommonVariableTotalSize = 0;\r
+      mVariableModuleGlobal->CommonUserVariableTotalSize = 0;\r
       Variable = GetStartPointer ((VARIABLE_STORE_HEADER *)(UINTN)VariableBase);\r
       while (IsValidVariableHeader (Variable, GetEndPointer ((VARIABLE_STORE_HEADER *)(UINTN)VariableBase))) {\r
         NextVariable = GetNextVariablePtr (Variable);\r