From 2e76dc7e79e1c2bc74cb1567352ad882e2d8d0c7 Mon Sep 17 00:00:00 2001 From: klu2 Date: Tue, 26 Jan 2010 04:28:30 +0000 Subject: [PATCH] Remove ASSERT() to make AllocatePool() service match PI spec. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9815 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index 6314f75999..e5dac2c581 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -1,7 +1,7 @@ /** @file EFI PEI Core memory services -Copyright (c) 2006, Intel Corporation +Copyright (c) 2006 - 2010, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -240,7 +240,10 @@ PeiAllocatePool ( // Generally, the size of heap in temporary memory does not exceed to 64K, // so the maxmium size of pool is 0x10000 - sizeof (EFI_HOB_MEMORY_POOL) // - ASSERT (Size < 0x10000 - sizeof (EFI_HOB_MEMORY_POOL)); + if (Size >= (0x10000 - sizeof (EFI_HOB_MEMORY_POOL))) { + return EFI_OUT_OF_RESOURCES; + } + Status = PeiServicesCreateHob ( EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + Size), -- 2.39.2