]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fs/coredump: linked list fallout
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 18 Dec 2020 18:54:49 +0000 (13:54 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:33:40 +0000 (12:33 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
fs/coredump.c

index 5b950af6e793e377ee28833f723d22dc46a58116..a69f281a08afbba800091f99e4a5adc7b489e803 100644 (file)
@@ -1040,10 +1040,10 @@ whole:
        return vma->vm_end - vma->vm_start;
 }
 
-static struct vm_area_struct *first_vma(struct task_struct *tsk,
+static struct vm_area_struct *first_vma(struct mm_struct *mm,
                                        struct vm_area_struct *gate_vma)
 {
-       struct vm_area_struct *ret = find_vma(tsk->mm, 0);
+       struct vm_area_struct *ret = find_vma(mm, 0);
 
        if (ret)
                return ret;
@@ -1054,12 +1054,13 @@ static struct vm_area_struct *first_vma(struct task_struct *tsk,
  * Helper function for iterating across a vma list.  It ensures that the caller
  * will visit `gate_vma' prior to terminating the search.
  */
-static struct vm_area_struct *next_vma(struct vm_area_struct *this_vma,
+static struct vm_area_struct *next_vma(struct mm_struct *mm,
+                                      struct vm_area_struct *this_vma,
                                       struct vm_area_struct *gate_vma)
 {
        struct vm_area_struct *ret;
 
-       ret = vma_next(this_vma->vm_mm, this_vma);
+       ret = vma_next(mm, this_vma);
        if (ret)
                return ret;
        if (this_vma == gate_vma)
@@ -1097,8 +1098,8 @@ int dump_vma_snapshot(struct coredump_params *cprm, int *vma_count,
                return -ENOMEM;
        }
 
-       for (i = 0, vma = first_vma(current, gate_vma); vma != NULL;
-                       vma = next_vma(vma, gate_vma), i++) {
+       for (i = 0, vma = first_vma(mm, gate_vma); vma != NULL;
+                       vma = next_vma(mm, vma, gate_vma), i++) {
                struct core_vma_metadata *m = (*vma_meta) + i;
 
                m->start = vma->vm_start;