From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.10833.1674031335516573627 for ; Wed, 18 Jan 2023 00:42:16 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ckj+DLsE; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674031335; x=1705567335; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YQZayobw3MpmDVOUR50UgCZAHtDvHp7V1qqwlw83LqU=; b=ckj+DLsEkE9Se4ZLFAOe5KkzuZK3DoojbeEyKvEh6uEwGPUdhUDnM8P8 hkJFflAwADyATLLPjmrFZABlandMywlkFzH0VXRCxpXxV/3kQZbJKZuhq 80IzRbzR9Vxxi8viVSl3lGDPVHn976fuJF8Y4rDR3JD72J5eJtGUIjGcS Be59hTovNOvyFv+EHelRQ1hmiBCd1eEPCV1lvBOKOa9/iegpczgHX9Nfj DlvyUQ7DfKbSsAvuZANIgkzwTEAWioA2zb3XpD/Wg3TNZ0LCW15KEwakZ dwUYBRG9+rVh63e4B4a6qdYVJB8VoAHirp9woLfqspVsF7gdRT/kT49Mi Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="326202396" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="326202396" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 00:42:14 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="659711499" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="659711499" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.169.184]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 00:42:11 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Liming Gao , Dandan Bi , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky , Michael Roth Subject: [PATCH V1 1/1] MdeModulePkg: EfiUnacceptedMemoryType is not allowed in AllocatePool Date: Wed, 18 Jan 2023 16:41:58 +0800 Message-Id: <20230118084158.1412-1-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu 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 --- 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 7aaf501600cf..b20cbfdedbab 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.29.2.windows.2