Skip to content

Commit

Permalink
proc: mem_release() should check mm != NULL
Browse files Browse the repository at this point in the history
mem_release() can hit mm == NULL, add the necessary check.

Cc: stable@kernel.org
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Feb 1, 2012
1 parent 879a5a0 commit 71879d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ loff_t mem_lseek(struct file *file, loff_t offset, int orig)
static int mem_release(struct inode *inode, struct file *file)
{
struct mm_struct *mm = file->private_data;

mmput(mm);
if (mm)
mmput(mm);
return 0;
}

Expand Down

0 comments on commit 71879d3

Please sign in to comment.