From: Oleg Nesterov Date: Tue, 31 Jan 2012 16:14:38 +0000 (+0100) Subject: proc: mem_release() should check mm != NULL X-Git-Tag: firefly_0821_release~7541^2~1803 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=401f63716ca0bca1728e55ccf2132fb3785cf5da;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/proc/base.c b/fs/proc/base.c index 7b28f27ad80b..b3e298f29421 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; }