Skip to content
Snippets Groups Projects
Commit cb22ff50 authored by Laura Abbott's avatar Laura Abbott Committed by Gerrit - the friendly Code Review server
Browse files

cma: Return 0 on error path


If a free CMA region cannot be found because every one is busy,
an error needs to be propegated up by returning a zero pfn.
Ensure the pfn is actually zero when returning an error.

Change-Id: I0d5a66a25c4483bf0f219cec1d7009239518f27a
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent ddd5f9e9
No related branches found
No related tags found
No related merge requests found
...@@ -550,6 +550,7 @@ unsigned long dma_alloc_from_contiguous(struct device *dev, int count, ...@@ -550,6 +550,7 @@ unsigned long dma_alloc_from_contiguous(struct device *dev, int count,
pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count, pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
start, count, mask); start, count, mask);
if (pageno >= cma->count) { if (pageno >= cma->count) {
pfn = 0;
mutex_unlock(&cma->lock); mutex_unlock(&cma->lock);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment