projects/linux·commit 0a2bc003

staging: android: ion: Return an ERR_PTR in ion_map_kernel

0a2bc003 · Laura Abbott <[email protected]> · 2018-06-11 11:06:53 -07:00

The expected return value from ion_map_kernel is an ERR_PTR. The error
path for a vmalloc failure currently just returns NULL, triggering
a warning in ion_buffer_kmap_get. Encode the vmalloc failure as an ERR_PTR.

Reported-by: [email protected]
Signed-off-by: Laura Abbott <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit
0a2bc00341dcfcc793c0dbf4f8d43adf60458b05
Parents
1376b0a2

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/staging/android/ion/ion_heap.cmodified+1−1View file

drivers/staging/android/ion/ion_heap.c

View file
diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
index e8c4403..31db510 100644
--- a/drivers/staging/android/ion/ion_heap.c
+++ b/drivers/staging/android/ion/ion_heap.c
@@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap,
struct page **tmp = pages;
if (!pages)
- return NULL;
+ return ERR_PTR(-ENOMEM);
if (buffer->flags & ION_FLAG_CACHED)
pgprot = PAGE_KERNEL;