mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
staging: android: ion: Return an ERR_PTR in ion_map_kernel
commit 0a2bc00341 upstream.
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: syzbot+55b1d9f811650de944c6@syzkaller.appspotmail.com
Signed-off-by: Laura Abbott <labbott@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a1f75c3f3a
commit
58fcaeb30e
@@ -38,7 +38,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;
|
||||
|
||||
Reference in New Issue
Block a user