X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FVariable%2FRuntimeDxe%2FVariableSmmRuntimeDxe.c;fp=MdeModulePkg%2FUniversal%2FVariable%2FRuntimeDxe%2FVariableSmmRuntimeDxe.c;h=ca833fb0244d1b62f10caaf939f932af5766b678;hp=2cf0ed32ae55bea2094e7bb578a60810c242dbc1;hb=edf88807f79c6064a22ec44428eade5f72179fb8;hpb=e1fbff3ded87704fb0086f9b5fb368080eb4db51
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
index 2cf0ed32ae..ca833fb024 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
@@ -14,6 +14,7 @@
InitCommunicateBuffer() is really function to check the variable data size.
Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -642,10 +643,6 @@ FindVariableInRuntimeCache (
}
CopyMem (Data, GetVariableDataPtr (RtPtrTrack.CurrPtr, mVariableAuthFormat), TempDataSize);
- if (Attributes != NULL) {
- *Attributes = RtPtrTrack.CurrPtr->Attributes;
- }
-
*DataSize = TempDataSize;
UpdateVariableInfo (VariableName, VendorGuid, RtPtrTrack.Volatile, TRUE, FALSE, FALSE, TRUE, &mVariableInfo);
@@ -661,6 +658,11 @@ FindVariableInRuntimeCache (
}
Done:
+ if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) {
+ if (Attributes != NULL && RtPtrTrack.CurrPtr != NULL) {
+ *Attributes = RtPtrTrack.CurrPtr->Attributes;
+ }
+ }
mVariableRuntimeCacheReadLock = FALSE;
return Status;