Skip to content

Commit

Permalink
CMA: correct unlock target
Browse files Browse the repository at this point in the history
'cma: Remove potential deadlock situation' introduces per cma area mutex
for bitmap management. It is good, but there is one mistake. When we
can't find appropriate area in bitmap, we release cma_mutex global lock
rather than cma->lock and this is a bug. So fix it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
  • Loading branch information
Joonsoo Kim authored and Marek Szyprowski committed May 29, 2014
1 parent bb56d0d commit f70e3c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/dma-contiguous.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
start, count, mask);
if (pageno >= cma->count) {
mutex_unlock(&cma_mutex);
mutex_unlock(&cma->lock);
break;
}
bitmap_set(cma->bitmap, pageno, count);
Expand Down

0 comments on commit f70e3c4

Please sign in to comment.