[PATCH] common: memory: fix off-by-one in tlsf_create

Marc Kleine-Budde mkl at pengutronix.de
Tue Apr 24 05:23:03 EDT 2012


Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
---
 common/memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/memory.c b/common/memory.c
index faff33b..3b4a5ef 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -58,7 +58,7 @@ void mem_malloc_init(void *start, void *end)
 	malloc_end = (unsigned long)end;
 	malloc_brk = malloc_start;
 #ifdef CONFIG_MALLOC_TLSF
-	tlsf_mem_pool = tlsf_create(start, (char *)end - (char *)start);
+	tlsf_mem_pool = tlsf_create(start, end - start + 1);
 #endif
 }
 
-- 
1.7.4.1




More information about the barebox mailing list