mem_malloc_end is the end address, so we need to add one to get the size
out.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
Forgot to squash
---
 include/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/memory.h b/include/memory.h
index 73642dd5aaa5..9c2a037610b6 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -12,7 +12,7 @@ ulong mem_malloc_end(void);
 
 static inline ulong mem_malloc_size(void)
 {
-       return mem_malloc_end() - mem_malloc_start();
+       return mem_malloc_end() - mem_malloc_start() + 1;
 }
 
 struct memory_bank {
-- 
2.39.2


Reply via email to