X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FVariable%2FRuntimeDxe%2FVariable.c;fp=MdeModulePkg%2FUniversal%2FVariable%2FRuntimeDxe%2FVariable.c;h=1e71fc642c763571a493ca0cd28e73f6ed5c6186;hb=edf88807f79c6064a22ec44428eade5f72179fb8;hp=d23aea4bc712d4afb7f90f8a52d17394353ae82c;hpb=e1fbff3ded87704fb0086f9b5fb368080eb4db51;p=mirror_edk2.git
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index d23aea4bc7..1e71fc642c 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -18,6 +18,8 @@
Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
(C) Copyright 2015-2018 Hewlett Packard Enterprise Development LP
+Copyright (c) Microsoft Corporation.
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -2379,9 +2381,6 @@ VariableServiceGetVariable (
}
CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr, mVariableModuleGlobal->VariableGlobal.AuthFormat), VarDataSize);
- if (Attributes != NULL) {
- *Attributes = Variable.CurrPtr->Attributes;
- }
*DataSize = VarDataSize;
UpdateVariableInfo (VariableName, VendorGuid, Variable.Volatile, TRUE, FALSE, FALSE, FALSE, &gVariableInfo);
@@ -2395,6 +2394,11 @@ VariableServiceGetVariable (
}
Done:
+ if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) {
+ if (Attributes != NULL && Variable.CurrPtr != NULL) {
+ *Attributes = Variable.CurrPtr->Attributes;
+ }
+ }
ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);
return Status;
}