summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-12-04 13:56:53 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-09 10:27:35 +0100
commit1eaadd3cef9882cd6d6af2f329b9450ef209e8e7 (patch)
treece200702b02621e33212ef5068166a04e0b36c6f /common
parent2c2fbeabf9c58cbf3162dcbc0aafd3093be558ee (diff)
downloadbarebox-1eaadd3cef9882cd6d6af2f329b9450ef209e8e7.tar.gz
barebox-1eaadd3cef9882cd6d6af2f329b9450ef209e8e7.tar.xz
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 <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/efi/efi.c2
1 files changed, 1 insertions, 1 deletions
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();