[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 <ddecotig@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/124/head
David Decotigny 2020-01-14 23:31:03 -08:00 committed by Michael Brown
parent cede0c5ba1
commit 45a0ca6de2
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}