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.
Unified · Split
| @@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap, · 29 unmodified lines | ||
| 30 | 30 | struct page **tmp = pages; |
| 31 | 31 | |
| 32 | 32 | if (!pages) |
| 33 | − return NULL; | |
| 33 | + return ERR_PTR(-ENOMEM); | |
| 34 | 34 | |
| 35 | 35 | if (buffer->flags & ION_FLAG_CACHED) |
| 36 | 36 | pgprot = PAGE_KERNEL; |