MdeModulePkg/SmmCorePerformanceLib: Update mPerformanceLength
[mirror_edk2.git] / MdeModulePkg / Library / SmmCorePerformanceLib / SmmCorePerformanceLib.c
index f18c3fb..e03d41e 100644 (file)
@@ -45,7 +45,7 @@ typedef struct {
 HANDLE_GUID_MAP      mCacheHandleGuidTable[CACHE_HANDLE_GUID_COUNT];\r
 UINTN                mCachePairCount = 0;\r
 \r
-UINT32               mPerformanceLength    = 0;\r
+UINT32               mPerformanceLength    = sizeof (SMM_BOOT_PERFORMANCE_TABLE);\r
 UINT32               mMaxPerformanceLength = 0;\r
 UINT32               mLoadImageCount       = 0;\r
 BOOLEAN              mFpdtDataIsReported   = FALSE;\r
@@ -100,15 +100,15 @@ GetFpdtRecordPtr (
     if (mPerformanceLength + RecordSize > mMaxPerformanceLength) {\r
       mSmmBootPerformanceTable = ReallocatePool (\r
                                    mPerformanceLength,\r
-                                   mPerformanceLength + sizeof (SMM_BOOT_PERFORMANCE_TABLE) + RecordSize + FIRMWARE_RECORD_BUFFER,\r
+                                   mPerformanceLength + RecordSize + FIRMWARE_RECORD_BUFFER,\r
                                    mSmmBootPerformanceTable\r
                               );\r
 \r
       if (mSmmBootPerformanceTable == NULL) {\r
         return EFI_OUT_OF_RESOURCES;\r
       }\r
-      mSmmBootPerformanceTable->Header.Length = sizeof (SMM_BOOT_PERFORMANCE_TABLE) + mPerformanceLength;\r
-      mMaxPerformanceLength = mPerformanceLength + sizeof (SMM_BOOT_PERFORMANCE_TABLE) + RecordSize + FIRMWARE_RECORD_BUFFER;\r
+      mSmmBootPerformanceTable->Header.Length = mPerformanceLength;\r
+      mMaxPerformanceLength = mPerformanceLength + RecordSize + FIRMWARE_RECORD_BUFFER;\r
     }\r
     //\r
     // Covert buffer to FPDT Ptr Union type.\r