From: Liam R. Howlett Date: Fri, 18 Jun 2021 00:31:19 +0000 (-0400) Subject: remap_file_pages: Use vma_lookup() instead of find_vma() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cab55442e8844e79a8a2630edcc6cf31432e2301;p=users%2Fjedix%2Flinux-maple.git remap_file_pages: Use vma_lookup() instead of find_vma() Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read code. Signed-off-by: Liam R. Howlett --- diff --git a/mm/mmap.c b/mm/mmap.c index ca54d36d203a..1e6fd4b2877e 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2992,14 +2992,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, if (mmap_write_lock_killable(mm)) return -EINTR; - vma = find_vma(mm, start); + vma = vma_lookup(mm, start); if (!vma || !(vma->vm_flags & VM_SHARED)) goto out; - if (start < vma->vm_start) - goto out; - if (start + size > vma->vm_end) { struct vm_area_struct *next;