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>
This commit is contained in:
parent
879a5a001b
commit
71879d3cb3
|
@ -822,8 +822,8 @@ loff_t mem_lseek(struct file *file, loff_t offset, int orig)
|
||||||
static int mem_release(struct inode *inode, struct file *file)
|
static int mem_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct mm_struct *mm = file->private_data;
|
struct mm_struct *mm = file->private_data;
|
||||||
|
if (mm)
|
||||||
mmput(mm);
|
mmput(mm);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue