staging: android: ion: Return an ERR_PTR in ion_map_kernel
authorLaura Abbott <labbott@redhat.com>
Mon, 11 Jun 2018 18:06:53 +0000 (11:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Jul 2018 13:30:47 +0000 (15:30 +0200)
commit2a7a8556b3b4d56e60b7e2edc57754e701ddb788
treeebca527d6e770d8061c8a2098120995593923cd9
parentc034d161fa63f35e0107b9c03d4b3108d2401a08
staging: android: ion: Return an ERR_PTR in ion_map_kernel

commit 0a2bc00341dcfcc793c0dbf4f8d43adf60458b05 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>
drivers/staging/android/ion/ion_heap.c