From 45a0ca6de221f8886a9bfb02f0d34af4fc2f1c5d Mon Sep 17 00:00:00 2001 From: David Decotigny Date: Tue, 14 Jan 2020 23:31:03 -0800 Subject: [PATCH] [pcbios] Fix "out of memory" detection when expanding bottom area This caused iPXE to reject images even when enough memory was available. Signed-off-by: David Decotigny Signed-off-by: Michael Brown --- src/arch/x86/interface/pcbios/memtop_umalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/x86/interface/pcbios/memtop_umalloc.c b/src/arch/x86/interface/pcbios/memtop_umalloc.c index f1ab73e29..d7b82189a 100644 --- a/src/arch/x86/interface/pcbios/memtop_umalloc.c +++ b/src/arch/x86/interface/pcbios/memtop_umalloc.c @@ -190,7 +190,7 @@ static userptr_t memtop_urealloc ( userptr_t ptr, size_t new_size ) { /* Expand/shrink block if possible */ if ( ptr == bottom ) { /* Update block */ - if ( new_size > ( heap_size - extmem.size ) ) { + if ( new_size > ( heap_size + extmem.size ) ) { DBG ( "EXTMEM out of space\n" ); return UNULL; }