android: ion: fix missing error number in cma heap
authorCho KyongHo <pullip.cho@samsung.com>
Thu, 22 Feb 2018 12:05:28 +0000 (21:05 +0900)
committerSangwook Ju <sw.ju@samsung.com>
Mon, 14 May 2018 10:45:23 +0000 (19:45 +0900)
Change-Id: Ib08aa1eefbeb954327ce8052471c621fb1a91063
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/staging/android/ion/ion_cma_heap.c

index 27d6d2ff972a170fa23d38dba0b6f82a83434715..f4e747e9477b8bb16d8a67448f799d9543deb0e5 100644 (file)
@@ -45,7 +45,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
        unsigned long size = PAGE_ALIGN(len);
        unsigned long nr_pages = size >> PAGE_SHIFT;
        unsigned long align = get_order(size);
-       int ret;
+       int ret = -ENOMEM;
 
        if (align > CONFIG_CMA_ALIGNMENT)
                align = CONFIG_CMA_ALIGNMENT;
@@ -92,7 +92,7 @@ free_mem:
        kfree(table);
 err:
        cma_release(cma_heap->cma, pages, nr_pages);
-       return -ENOMEM;
+       return ret;
 }
 
 static void ion_cma_free(struct ion_buffer *buffer)