Skip to content

Commit

Permalink
mm: remove prev check from do_vmi_align_munmap()
Browse files Browse the repository at this point in the history
If the prev does not exist, the vma iterator will be set to MAS_NONE,
which will be treated as a MAS_START when the mas_next or mas_find is
used.  In this case, the next caller will be the vma iterator, which
uses mas_find() under the hood and will now do what the user expects.

Link: https://lkml.kernel.org/r/20230724183157.3939892-5-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Liam R. Howlett authored and Andrew Morton committed Aug 18, 2023
1 parent fd89259 commit 445a2ea
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2459,8 +2459,6 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
}

prev = vma_prev(vmi);
if (unlikely((!prev)))
vma_iter_set(vmi, start);

/*
* Detach a range of VMAs from the mm. Using next as a temp variable as
Expand Down

0 comments on commit 445a2ea

Please sign in to comment.