If find_vma returns a vma, it must satisfies that start < vma->vm_end. Since vma list is sorted in the ascending order, so we will never see start >= vma->vm_end here. Remove this unneeded check. Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx> --- mm/mlock.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/mlock.c b/mm/mlock.c index fefa9644d0f9..fe278634ebe3 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -509,8 +509,6 @@ static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm, return 0; for (; vma ; vma = vma->vm_next) { - if (start >= vma->vm_end) - continue; if (start + len <= vma->vm_start) break; if (vma->vm_flags & VM_LOCKED) { -- 2.23.0