]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/migrate: Use vma_lookup() in do_pages_stat_array()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 8 Apr 2021 20:24:41 +0000 (16:24 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 10 May 2021 16:39:28 +0000 (12:39 -0400)
Use vma_lookup() to find the VMA at a specific address.  As vma_lookup()
will return NULL if the address is not within any VMA, the start address
no longer needs to be validated.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/migrate.c

index b234c3f3acb7941abf1a558d6e0c5a28d2b1f3d6..611781c0f9b549f5a4402a746e9ec3eee27671c5 100644 (file)
@@ -1833,8 +1833,8 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
                struct page *page;
                int err = -EFAULT;
 
-               vma = find_vma(mm, addr);
-               if (!vma || addr < vma->vm_start)
+               vma = vma_lookup(mm, addr);
+               if (!vma)
                        goto set_status;
 
                /* FOLL_DUMP to ignore special (like zero) pages */