diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-01-31 17:14:38 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-13 11:16:53 -0800 |
commit | 3a196fbe2650a4465d49f6e84d9360eab60e3bcb (patch) | |
tree | a6725a879ec2688c1e37a869f8640a69f6439b09 | |
parent | 58f75a56e37352b7dea174ee75f2ca52218370a7 (diff) | |
download | kernel-common-3a196fbe2650a4465d49f6e84d9360eab60e3bcb.tar.gz kernel-common-3a196fbe2650a4465d49f6e84d9360eab60e3bcb.tar.bz2 kernel-common-3a196fbe2650a4465d49f6e84d9360eab60e3bcb.zip |
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>
-rw-r--r-- | fs/proc/base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 1fc1dca608ed..a43c70a4783a 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; } |