diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-01 22:24:04 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-03 10:09:29 +0100 |
commit | 70f7691d4110c4384e058ae3e64003ca9ad963a6 (patch) | |
tree | 883b96df18765d37563a03f3b8a2e3dcfefbf759 /arch/x86 | |
parent | e88417b5ef9de74944bf3d8fa86f184abbac68ea (diff) | |
download | barebox-70f7691d4110c4384e058ae3e64003ca9ad963a6.tar.gz barebox-70f7691d4110c4384e058ae3e64003ca9ad963a6.tar.xz |
fix malloc space sizes
end is start + size - 1, not start + size.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/memory.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/lib/memory.c b/arch/x86/lib/memory.c index fa7bc03962..1774ef34fd 100644 --- a/arch/x86/lib/memory.c +++ b/arch/x86/lib/memory.c @@ -54,12 +54,12 @@ static int x86_mem_malloc_init(void) */ if (memory_size >= (15 * 1024 * 1024 + MALLOC_SIZE)) mem_malloc_init((void*)(16 * 1024 * 1024), - (void*)(16 * 1024 * 1024) + MALLOC_SIZE); + (void*)(16 * 1024 * 1024 + MALLOC_SIZE - 1)); else return -1; #else mem_malloc_init((void *)MALLOC_BASE, - (void *)(MALLOC_BASE + MALLOC_SIZE)); + (void *)(MALLOC_BASE + MALLOC_SIZE - 1)); #endif return 0; } |