MdeModulePkg/PiSmmCore: Fix an assert issue in pool free

Following check-in caused this issue:
  2930ef9809976ce693d1d377851344c3b06bd926

This issue is caused by assigning incorrect value to PoolHdr.Size
if the requested size is more than MAX_POOL_SIZE, because the SMM
core will actually allocate page memory instead of pool memory in
this situation.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Wu Hao <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Wu Hao <hao.a.wu@intel.com>
Tested-by: Wu Hao <hao.a.wu@intel.com>
This commit is contained in:
Jian J Wang 2017-11-20 09:00:27 +08:00 committed by Hao Wu
parent e259779974
commit 94edadf502

View File

@ -287,7 +287,7 @@ SmmInternalAllocatePool (
PoolHdr = (POOL_HEADER*)(UINTN)Address;
PoolHdr->Signature = POOL_HEAD_SIGNATURE;
PoolHdr->Size = Size;
PoolHdr->Size = EFI_PAGES_TO_SIZE (NoPages);
PoolHdr->Available = FALSE;
PoolHdr->Type = PoolType;