X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FVariable%2FRuntimeDxe%2FVariableDxe.c;fp=MdeModulePkg%2FUniversal%2FVariable%2FRuntimeDxe%2FVariableDxe.c;h=f7185df3a7eb5bf06e0ffd9a5010bb8a6fd7efe8;hp=23186176be756fce424cd7165f06e5672444e6dd;hb=874c8434d1f80ddcac6fb2237ae644b25a8b4ecd;hpb=62a623debd9f7d40823ac1851939f6ee9255382c diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index 23186176be..f7185df3a7 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -3,7 +3,7 @@ and volatile storage space and install variable architecture protocol. Copyright (C) 2013, Red Hat, Inc. -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -402,8 +402,8 @@ FtwNotificationEvent ( // // Mark the variable storage region of the FLASH as RUNTIME. // - VariableStoreBase = NvStorageVariableBase + (((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)(NvStorageVariableBase))->HeaderLength); - VariableStoreLength = ((VARIABLE_STORE_HEADER *)(UINTN)VariableStoreBase)->Size; + VariableStoreBase = NvStorageVariableBase + mNvFvHeaderCache->HeaderLength; + VariableStoreLength = mNvVariableCache->Size; BaseAddress = VariableStoreBase & (~EFI_PAGE_MASK); Length = VariableStoreLength + (VariableStoreBase - BaseAddress); Length = (Length + EFI_PAGE_SIZE - 1) & (~EFI_PAGE_MASK);