From: Liam R. Howlett Date: Thu, 8 Apr 2021 20:24:41 +0000 (-0400) Subject: mm/migrate: Use vma_lookup() in do_pages_stat_array() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=da4442160cb9ecb9a022a4435a280ac0960cf4b4;p=users%2Fjedix%2Flinux-maple.git mm/migrate: Use vma_lookup() in do_pages_stat_array() 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 --- diff --git a/mm/migrate.c b/mm/migrate.c index b234c3f3acb79..611781c0f9b54 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -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 */