Merge "mm: cma: check the max limit for cma allocation"

This commit is contained in:
Linux Build Service Account 2016-12-19 00:44:42 -08:00 committed by Gerrit - the friendly Code Review server
commit 0bdc62e764

View file

@ -392,6 +392,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,