From 630f956b7797abb582cbda27e857b57c5da63932 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 4 Jan 2021 14:44:16 -0500 Subject: [PATCH] binfmt_elf: Remove vma linked list walk Use the VMA iterator instead. Signed-off-by: Liam R. Howlett --- fs/binfmt_elf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 69d900a8473d..fd82040a01a9 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -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; -- 2.50.1