diff options
| author | bernard.xiong <[email protected]> | 2010-11-30 06:57:30 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-11-30 06:57:30 +0000 |
| commit | b13215b7c77c4729418554cc4fc9e01c35ef2880 (patch) | |
| tree | e405f156784dfad09aeb0100f0856e7efbd77228 /src | |
| parent | 7880b57f3c48453921e56778bb1e442386602d81 (diff) | |
fix malloc(0xffffffff) issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1154 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src')
| -rw-r--r-- | src/slab.c | 2 |
1 files changed, 1 insertions, 1 deletions
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)) { |
