From b2c59ce83cf857cfe9868525526001a7944f3d33 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Tue, 29 Dec 2015 09:00:58 +0000 Subject: MdeModulePkg Variable: ###VariableTotalSize need to be initialized to 0 first HwErrVariableTotalSize/CommonVariableTotalSize/CommonUserVariableTotalSize need to be initialized to 0 first after reclaim failed, then to be assigned by += operation. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Liming Gao 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 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'MdeModulePkg/Universal') diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 8a07f0ecb6..1cb0409e97 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -1191,6 +1191,9 @@ Reclaim ( mVariableModuleGlobal->CommonVariableTotalSize = CommonVariableTotalSize; mVariableModuleGlobal->CommonUserVariableTotalSize = CommonUserVariableTotalSize; } else { + mVariableModuleGlobal->HwErrVariableTotalSize = 0; + mVariableModuleGlobal->CommonVariableTotalSize = 0; + mVariableModuleGlobal->CommonUserVariableTotalSize = 0; Variable = GetStartPointer ((VARIABLE_STORE_HEADER *)(UINTN)VariableBase); while (IsValidVariableHeader (Variable, GetEndPointer ((VARIABLE_STORE_HEADER *)(UINTN)VariableBase))) { NextVariable = GetNextVariablePtr (Variable); -- cgit v1.2.3