summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2023-01-18 16:41:58 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-02-07 05:33:38 +0000
commit96192ba5bd4f86a5503d40c9c6b9c0fdcb631dc0 (patch)
treef28f216852e163c0e6a70c8964ebb44901854aa8
parent8a763b533bb1b10af2831f6c35d6545bdd5c69d1 (diff)
downloadedk2-96192ba5bd4f86a5503d40c9c6b9c0fdcb631dc0.tar.gz
edk2-96192ba5bd4f86a5503d40c9c6b9c0fdcb631dc0.tar.bz2
edk2-96192ba5bd4f86a5503d40c9c6b9c0fdcb631dc0.zip
MdeModulePkg: EfiUnacceptedMemoryType is not allowed in AllocatePool
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4315 MemoryType of EfiUnacceptedMemoryType should not be allocated in AllocatePool. Instead it should return EFI_INVALID_PARAMETER. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Michael Roth <michael.roth@amd.com> Reported-by: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Pool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c
index 7aaf501600..b20cbfdedb 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Pool.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c
@@ -213,7 +213,7 @@ CoreInternalAllocatePool (
// If it's not a valid type, fail it
//
if (((PoolType >= EfiMaxMemoryType) && (PoolType < MEMORY_TYPE_OEM_RESERVED_MIN)) ||
- (PoolType == EfiConventionalMemory) || (PoolType == EfiPersistentMemory))
+ (PoolType == EfiConventionalMemory) || (PoolType == EfiPersistentMemory) || (PoolType == EfiUnacceptedMemoryType))
{
return EFI_INVALID_PARAMETER;
}