]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arch/m68k/kernel/sys_m68k: Use vma_lookup() in sys_cacheflush()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 9 Apr 2021 00:54:37 +0000 (20:54 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 10 May 2021 16:39:27 +0000 (12:39 -0400)
Using vma_lookup() enables for simplified checking of the returned vma
to ensure the end address also falls within the same vma.  The start
address must be in the returned vma from vma_lookup().

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/m68k/kernel/sys_m68k.c

index f55bdcb8e4f15723d1cc4333ea04a05e9835a08b..bd0274c7592e0c14921d638e939fc509e0502c2b 100644 (file)
@@ -402,8 +402,8 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
                 * to this process.
                 */
                mmap_read_lock(current->mm);
-               vma = find_vma(current->mm, addr);
-               if (!vma || addr < vma->vm_start || addr + len > vma->vm_end)
+               vma = vma_lookup(current->mm, addr);
+               if (!vma || addr + len > vma->vm_end)
                        goto out_unlock;
        }