]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
proc: mem_release() should check mm != NULL
authorOleg Nesterov <oleg@redhat.com>
Tue, 31 Jan 2012 16:14:38 +0000 (17:14 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 6 Mar 2012 22:01:25 +0000 (14:01 -0800)
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>
(cherry picked from commit 71879d3cb3dd8f2dfdefb252775c1b3ea04a3dd4)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
For Oracle bug 13811116

fs/proc/base.c

index cf99f22011d3688ce2435083ab51bbdc0853dcbf..49b82beec31858fa31e95b2e1967841cc45f9225 100644 (file)
@@ -860,8 +860,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;
 }