diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-01-31 11:14:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-02-01 17:39:01 -0500 |
commit | 71879d3cb3dd8f2dfdefb252775c1b3ea04a3dd4 (patch) | |
tree | befc1bd5504c6d97a24a2d519de19eaa3af0906f | |
parent | 879a5a001b62a020e074d460b3a7c0fd993f9832 (diff) |
proc: mem_release() should check mm != NULL
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>
-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 9cde9edf9c4d..c3617ea7830b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -822,8 +822,8 @@ loff_t mem_lseek(struct file *file, loff_t offset, int orig) | |||
822 | static int mem_release(struct inode *inode, struct file *file) | 822 | static int mem_release(struct inode *inode, struct file *file) |
823 | { | 823 | { |
824 | struct mm_struct *mm = file->private_data; | 824 | struct mm_struct *mm = file->private_data; |
825 | 825 | if (mm) | |
826 | mmput(mm); | 826 | mmput(mm); |
827 | return 0; | 827 | return 0; |
828 | } | 828 | } |
829 | 829 | ||