Browse Source

fix malloc(0xffffffff) issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1154 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 14 years ago
parent
commit
b13215b7c7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/slab.c

+ 1 - 1
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))
 	{