mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 17:51:57 +09:00
proc: mem_release() should check mm != NULL
commit 71879d3cb3 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
344d390bcb
commit
401f63716c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user