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 <a.fat...@pengutronix.de>
---
 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 73cea3703695..ed8158355020 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();
 
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to