From 96192ba5bd4f86a5503d40c9c6b9c0fdcb631dc0 Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Wed, 18 Jan 2023 16:41:58 +0800 Subject: [PATCH] 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 --- MdeModulePkg/Core/Dxe/Mem/Pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.2