rk_fb: sysfs: make use vmap/vunmap in pairs.
[firefly-linux-kernel-4.4.55.git] / mm / mmap.c
index 9aa554b7e620e1c0596a45035fbf0ebc3372dd0e..2e768e37c2a78ba4e56b5c26c7c72829cc271996 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2571,6 +2571,16 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
        detach_vmas_to_be_unmapped(mm, vma, prev, end);
        unmap_region(mm, vma, prev, start, end);
 
+#ifdef CONFIG_ARCH_ROCKCHIP
+       {
+               extern int ion_munmap(void *dmabuf, struct vm_area_struct *vma);
+               extern int dma_buf_is_dma_buf(struct file *file);
+               if (vma->vm_file && dma_buf_is_dma_buf(vma->vm_file)) {
+                       ion_munmap(vma->vm_file->private_data, vma);
+               }
+       }
+#endif
+
        /* Fix up all other VM information */
        remove_vma_list(mm, vma);