From: Rebecca Schultz Zavin Date: Fri, 10 Aug 2012 04:29:52 +0000 (-0700) Subject: gpu: ion: Only map as much of the vma as the user requested X-Git-Tag: firefly_0821_release~4090^2~691 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=acc6b1e7ebc6b98d197204200c049f3394c88ae1;p=firefly-linux-kernel-4.4.55.git gpu: ion: Only map as much of the vma as the user requested Change-Id: If0e368e192941c118683ab74aed48e4e0cb5731d Signed-off-by: Rebecca Schultz Zavin --- diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c index 726448d43fc1..e7fb07d45a2a 100644 --- a/drivers/gpu/ion/ion_system_heap.c +++ b/drivers/gpu/ion/ion_system_heap.c @@ -192,6 +192,8 @@ int ion_system_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, remap_pfn_range(vma, addr, page_to_pfn(sg_page(sg)), sg_dma_len(sg), vma->vm_page_prot); addr += sg_dma_len(sg); + if (addr >= vma->vm_end) + return 0; } return 0; }