mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/Core: Fix incorrect memory map generated in a rare case
The root cause is that mImagePropertiesPrivateData.CodeSegmentCountMax was not updated with correct value due to the fact that SortImageRecord() called before might change the content of current ImageRecord. This will in turn cause incorrect memory map entries generated in SplitTable(). Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
e9dfa1b519
commit
3d817fd11a
|
@ -1229,12 +1229,12 @@ InsertImageRecord (
|
||||||
InsertTailList (&mImagePropertiesPrivateData.ImageRecordList, &ImageRecord->Link);
|
InsertTailList (&mImagePropertiesPrivateData.ImageRecordList, &ImageRecord->Link);
|
||||||
mImagePropertiesPrivateData.ImageRecordCount++;
|
mImagePropertiesPrivateData.ImageRecordCount++;
|
||||||
|
|
||||||
SortImageRecord ();
|
|
||||||
|
|
||||||
if (mImagePropertiesPrivateData.CodeSegmentCountMax < ImageRecord->CodeSegmentCount) {
|
if (mImagePropertiesPrivateData.CodeSegmentCountMax < ImageRecord->CodeSegmentCount) {
|
||||||
mImagePropertiesPrivateData.CodeSegmentCountMax = ImageRecord->CodeSegmentCount;
|
mImagePropertiesPrivateData.CodeSegmentCountMax = ImageRecord->CodeSegmentCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SortImageRecord ();
|
||||||
|
|
||||||
Finish:
|
Finish:
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1214,12 +1214,12 @@ SmmInsertImageRecord (
|
||||||
InsertTailList (&mImagePropertiesPrivateData.ImageRecordList, &ImageRecord->Link);
|
InsertTailList (&mImagePropertiesPrivateData.ImageRecordList, &ImageRecord->Link);
|
||||||
mImagePropertiesPrivateData.ImageRecordCount++;
|
mImagePropertiesPrivateData.ImageRecordCount++;
|
||||||
|
|
||||||
SortImageRecord ();
|
|
||||||
|
|
||||||
if (mImagePropertiesPrivateData.CodeSegmentCountMax < ImageRecord->CodeSegmentCount) {
|
if (mImagePropertiesPrivateData.CodeSegmentCountMax < ImageRecord->CodeSegmentCount) {
|
||||||
mImagePropertiesPrivateData.CodeSegmentCountMax = ImageRecord->CodeSegmentCount;
|
mImagePropertiesPrivateData.CodeSegmentCountMax = ImageRecord->CodeSegmentCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SortImageRecord ();
|
||||||
|
|
||||||
Finish:
|
Finish:
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue