[U-Boot] [PATCH] malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure

karl.beldan at gmail.com karl.beldan at gmail.com
Tue Apr 6 22:18:08 CEST 2010


Signed-off-by: Karl Beldan <karl.beldan at gmail.com>
---
 common/dlmalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 205fc40..2276532 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1515,7 +1515,7 @@ void *sbrk(ptrdiff_t increment)
 	ulong new = old + increment;
 
 	if ((new < mem_malloc_start) || (new > mem_malloc_end))
-		return NULL;
+		return (void *)MORECORE_FAILURE;
 
 	mem_malloc_brk = new;
 
-- 
1.7.0.2.323.g0d092



More information about the U-Boot mailing list