Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da2b3bff authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 240f57eb f31c85ef
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -367,6 +367,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(cma->bitmap,