From 1eaadd3cef9882cd6d6af2f329b9450ef209e8e7 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 4 Dec 2019 13:56:53 +0100 Subject: efi: fix off-by-one in mem_malloc_init(..., end) The second (end) parameter of mem_malloc_init() denotes the last address in the malloc region, so we need to subtract one from the current value to arrive at the correct end. So far this went not noticed, because iomem doesn't yet display barebox malloc memory region. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- common/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/efi/efi.c b/common/efi/efi.c index 73cea37036..ed81583550 100644 --- a/common/efi/efi.c +++ b/common/efi/efi.c @@ -361,7 +361,7 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table) if (EFI_ERROR(efiret)) panic("failed to allocate malloc pool: %s\n", efi_strerror(efiret)); - mem_malloc_init((void *)mem, (void *)mem + memsize); + mem_malloc_init((void *)mem, (void *)mem + memsize - 1); start_barebox(); -- cgit v1.2.3