gpu: ion: Map only the vma size given
authorLaura Abbott <lauraa@codeaurora.org>
Fri, 16 Mar 2012 22:33:39 +0000 (15:33 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 20:40:49 +0000 (13:40 -0700)
When mapping carveout buffers into userspace, only map
the size of the vma given, not the full size of the buffer
since clients may map less than the buffer size.

Change-Id: I1b391b23219455e879a900d947c728db3c8c4a76
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
drivers/gpu/ion/ion_carveout_heap.c

index b4fcb3c9247950c59e7f213a75b02d3896769164..47690c2e08803a54a22a0c71b496942a123404ce 100644 (file)
@@ -116,7 +116,7 @@ int ion_carveout_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer,
 {
        return remap_pfn_range(vma, vma->vm_start,
                               __phys_to_pfn(buffer->priv_phys) + vma->vm_pgoff,
-                              buffer->size,
+                              vma->vm_end - vma->vm_start,
                               pgprot_noncached(vma->vm_page_prot));
 }