diff options
author | Dun Tan <dun.tan@intel.com> | 2024-05-27 17:37:41 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-06-17 13:42:43 +0000 |
commit | c1c2e474a23ab134f93266815a1b4c147b0e9b48 (patch) | |
tree | 879742edb47cfde2c7f07eed578da2d083519002 | |
parent | 645d9f6f8d221802dc9cdf22b05139b593817507 (diff) | |
download | edk2-c1c2e474a23ab134f93266815a1b4c147b0e9b48.tar.gz edk2-c1c2e474a23ab134f93266815a1b4c147b0e9b48.tar.bz2 edk2-c1c2e474a23ab134f93266815a1b4c147b0e9b48.zip |
MdeModulePkg:Remove unneed FreePages for RuntimeHobCacheBuffer
Remove unneed FreePages() for RuntimeHobCacheBuffer which is
allocated in PEI phase.
So the global variable mVariableRuntimeHobCacheBufferSize
also can be removed.
Signed-off-by: Dun Tan <dun.tan@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 8b42ae7d72..68082497d2 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -54,7 +54,6 @@ VARIABLE_STORE_HEADER *mVariableRuntimeHobCacheBuffer = NULL; VARIABLE_STORE_HEADER *mVariableRuntimeNvCacheBuffer = NULL;
VARIABLE_STORE_HEADER *mVariableRuntimeVolatileCacheBuffer = NULL;
UINTN mVariableBufferSize;
-UINTN mVariableRuntimeHobCacheBufferSize;
UINTN mVariableBufferPayloadSize;
BOOLEAN mVariableRuntimeCachePendingUpdate;
BOOLEAN mVariableRuntimeCacheReadLock;
@@ -578,10 +577,6 @@ CheckForRuntimeCacheSync ( // The HOB variable data may have finished being flushed in the runtime cache sync update
//
if (mHobFlushComplete && (mVariableRuntimeHobCacheBuffer != NULL)) {
- if (!EfiAtRuntime ()) {
- FreePages (mVariableRuntimeHobCacheBuffer, EFI_SIZE_TO_PAGES (mVariableRuntimeHobCacheBufferSize));
- }
-
mVariableRuntimeHobCacheBuffer = NULL;
}
}
@@ -1691,6 +1686,7 @@ SmmVariableReady ( EFI_STATUS Status;
UINTN RuntimeNvCacheSize;
UINTN RuntimeVolatileCacheSize;
+ UINTN RuntimeHobCacheBufferSize;
Status = gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **)&mSmmVariable);
if (EFI_ERROR (Status)) {
@@ -1720,13 +1716,13 @@ SmmVariableReady ( // Allocate runtime variable cache memory buffers.
//
Status = GetRuntimeCacheInfo (
- &mVariableRuntimeHobCacheBufferSize,
+ &RuntimeHobCacheBufferSize,
&RuntimeNvCacheSize,
&RuntimeVolatileCacheSize,
&mVariableAuthFormat
);
if (!EFI_ERROR (Status)) {
- Status = InitVariableCache (&mVariableRuntimeHobCacheBuffer, &mVariableRuntimeHobCacheBufferSize);
+ Status = InitVariableCache (&mVariableRuntimeHobCacheBuffer, &RuntimeHobCacheBufferSize);
if (!EFI_ERROR (Status)) {
Status = InitVariableCache (&mVariableRuntimeNvCacheBuffer, &RuntimeNvCacheSize);
if (!EFI_ERROR (Status)) {
|