From: Joonsoo Kim Date: Thu, 29 May 2014 06:29:18 +0000 (+0900) Subject: CMA: correct unlock target X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f70e3c4f8b6ab61f713e040822ec51f5de498146;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git CMA: correct unlock target '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 Signed-off-by: Marek Szyprowski --- diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 7b0217c863a7..c34ec3364243 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -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);