From 13731de6add8a543b1fc9ea292197d81a517ef9e Mon Sep 17 00:00:00 2001
From: Chintan Pandya <cpandya@codeaurora.org>
Date: Fri, 18 Apr 2014 12:45:36 +0530
Subject: [PATCH] dma-contiguous: Retrun 'zero' pfn in case of error

When CMA allocator gets error return from the page
allocator framework, except for the -EBUSY case, it
will bail out. Caller depends on the 'pfn' for
confirming allocation successful or not. Return 0
for those error case.

Change-Id: Ica4e04a9f9f18b1a29035ba2bae9deecfd68a5e8
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
---
 drivers/base/dma-contiguous.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index ef9e6496186f..857f5785dc08 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -570,6 +570,7 @@ unsigned long dma_alloc_from_contiguous(struct device *dev, int count,
 		if (ret == 0) {
 			break;
 		} else if (ret != -EBUSY) {
+			pfn = 0;
 			clear_cma_bitmap(cma, pfn, count);
 			break;
 		}
-- 
GitLab