From b13215b7c77c4729418554cc4fc9e01c35ef2880 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Tue, 30 Nov 2010 06:57:30 +0000 Subject: [PATCH] fix malloc(0xffffffff) issue. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1154 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/slab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slab.c b/src/slab.c index 490c1c0fcc..ffcdcb9cb3 100644 --- a/src/slab.c +++ b/src/slab.c @@ -233,7 +233,7 @@ void *rt_page_alloc(rt_size_t npages) struct rt_page_head *b, *n; struct rt_page_head **prev; - RT_ASSERT(npages != 0); + if(npages == 0) return RT_NULL; for (prev = &rt_page_list; (b = *prev) != RT_NULL; prev = &(b->next)) {