Skip to content

Commit 33fc9e2

Browse files
Roguebanthagregkh
authored andcommitted
mm: /proc/pid/smaps_rollup: fix no vma's null-deref
Commit 258f669 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file") introduced a null-deref if there are no vma's in the task in show_smaps_rollup. Fixes: 258f669 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file") Signed-off-by: Seth Jenkins <[email protected]> Reviewed-by: Alexey Dobriyan <[email protected]> Tested-by: Alexey Dobriyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b9d8cbe commit 33fc9e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/proc/task_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ static int show_smaps_rollup(struct seq_file *m, void *v)
951951
vma = vma->vm_next;
952952
}
953953

954-
show_vma_header_prefix(m, priv->mm->mmap->vm_start,
954+
show_vma_header_prefix(m, priv->mm->mmap ? priv->mm->mmap->vm_start : 0,
955955
last_vma_end, 0, 0, 0, 0);
956956
seq_pad(m, ' ');
957957
seq_puts(m, "[rollup]\n");

0 commit comments

Comments
 (0)