projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
mm/cma.c: check the max limit for cma allocation
[linux-2.6-microblaze.git]
/
mm
/
cma.c
diff --git
a/mm/cma.c
b/mm/cma.c
index
384c2cb
..
c960459
100644
(file)
--- a/
mm/cma.c
+++ b/
mm/cma.c
@@
-385,6
+385,9
@@
struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align)
bitmap_maxno = cma_bitmap_maxno(cma);
bitmap_count = cma_bitmap_pages_to_bits(cma, count);
+ if (bitmap_count > bitmap_maxno)
+ return NULL;
+
for (;;) {
mutex_lock(&cma->lock);
bitmap_no = bitmap_find_next_zero_area_off(cma->bitmap,