From: Liam R. Howlett Date: Mon, 4 Jan 2021 19:44:16 +0000 (-0500) Subject: binfmt_elf: Remove vma linked list walk X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=69d0cdb1f7e159e6e733bea4d4d8ea2a48439161;p=users%2Fjedix%2Flinux-maple.git binfmt_elf: Remove vma linked list walk Use the VMA iterator instead. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index f8c7f26f1fbb3..d41cca755ff9f 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1622,6 +1622,7 @@ static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata, static int fill_files_note(struct memelfnote *note) { struct mm_struct *mm = current->mm; + VMA_ITERATOR(vmi, mm, 0); struct vm_area_struct *vma; unsigned count, size, names_ofs, remaining, n; user_long_t *data; @@ -1651,7 +1652,7 @@ static int fill_files_note(struct memelfnote *note) name_base = name_curpos = ((char *)data) + names_ofs; remaining = size - names_ofs; count = 0; - for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) { + for_each_vma(vmi, vma) { struct file *file; const char *filename;