]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
binfmt_elf: Remove vma linked list walk
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:44:16 +0000 (14:44 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 30 Oct 2021 03:38:43 +0000 (23:38 -0400)
Use the VMA iterator instead.

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

index 69d900a8473d4e39080635697796e9ec340b7b5e..fd82040a01a9fa1bfe9301ffeb91ba4f0500b1e6 100644 (file)
@@ -1609,6 +1609,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;
@@ -1638,7 +1639,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;