Commit 3fcd03e0 authored by Gavin Lambert's avatar Gavin Lambert Committed by Linus Torvalds

[PATCH] NOMMU: don't try and give NULL to fput()

Don't try and give NULL to fput() in the error handling in do_mmap_pgoff()
as it'll cause an oops.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ab8e92ef
...@@ -948,6 +948,7 @@ unsigned long do_mmap_pgoff(struct file *file, ...@@ -948,6 +948,7 @@ unsigned long do_mmap_pgoff(struct file *file,
up_write(&nommu_vma_sem); up_write(&nommu_vma_sem);
kfree(vml); kfree(vml);
if (vma) { if (vma) {
if (vma->vm_file)
fput(vma->vm_file); fput(vma->vm_file);
kfree(vma); kfree(vma);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment