aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/ion/ion_carveout_heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/ion/ion_carveout_heap.c')
-rw-r--r--drivers/gpu/ion/ion_carveout_heap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/ion/ion_carveout_heap.c b/drivers/gpu/ion/ion_carveout_heap.c
index ce8d311968f..86f35545eaf 100644
--- a/drivers/gpu/ion/ion_carveout_heap.c
+++ b/drivers/gpu/ion/ion_carveout_heap.c
@@ -112,13 +112,18 @@ void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
void *ion_carveout_heap_map_kernel(struct ion_heap *heap,
struct ion_buffer *buffer)
{
+ void *ret;
int mtype = MT_MEMORY_NONCACHED;
if (buffer->flags & ION_FLAG_CACHED)
mtype = MT_MEMORY;
- return __arm_ioremap(buffer->priv_phys, buffer->size,
+ ret = __arm_ioremap(buffer->priv_phys, buffer->size,
mtype);
+ if (ret == NULL)
+ return ERR_PTR(-ENOMEM);
+
+ return ret;
}
void ion_carveout_heap_unmap_kernel(struct ion_heap *heap,