Skip to content

Commit 0a2bc00

Browse files
labbottgregkh
authored andcommitted
staging: android: ion: Return an ERR_PTR in ion_map_kernel
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]>
1 parent 1376b0a commit 0a2bc00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/android/ion/ion_heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap,
3030
struct page **tmp = pages;
3131

3232
if (!pages)
33-
return NULL;
33+
return ERR_PTR(-ENOMEM);
3434

3535
if (buffer->flags & ION_FLAG_CACHED)
3636
pgprot = PAGE_KERNEL;

0 commit comments

Comments
 (0)