Skip to content

Commit

Permalink
[pcbios] Fix "out of memory" detection when expanding bottom area
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
DavidDecotigny authored and mcb30 committed Jul 21, 2020
1 parent cede0c5 commit 45a0ca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arch/x86/interface/pcbios/memtop_umalloc.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 45a0ca6

Please sign in to comment.