From: Min M Xu Date: Wed, 18 Jan 2023 08:41:58 +0000 (+0800) Subject: MdeModulePkg: EfiUnacceptedMemoryType is not allowed in AllocatePool X-Git-Tag: edk2-stable202302~42 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=96192ba5bd4f86a5503d40c9c6b9c0fdcb631dc0 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 Cc: Dandan Bi Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Michael Roth Reported-by: Liming Gao Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Reviewed-by: Liming Gao --- 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; }