aboutsummaryrefslogtreecommitdiff
path: root/fs/proc
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-01-31 17:14:38 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-13 11:06:05 -0800
commit401f63716ca0bca1728e55ccf2132fb3785cf5da (patch)
tree96fc7f31c483fe96a2c6d283c6602dcd75212ecb /fs/proc
parent344d390bcb4c796b4b7797395cfc07e2c43d935d (diff)
proc: mem_release() should check mm != NULL
commit 71879d3cb3dd8f2dfdefb252775c1b3ea04a3dd4 upstream. mem_release() can hit mm == NULL, add the necessary check. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7b28f27ad80..b3e298f2942 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -886,8 +886,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;
}