Skip to content

Commit

Permalink
[PATCH] NOMMU: don't try and give NULL to fput()
Browse files Browse the repository at this point in the history
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: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
uecasm authored and Linus Torvalds committed Oct 1, 2006
1 parent ab8e92e commit 3fcd03e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,8 @@ unsigned long do_mmap_pgoff(struct file *file,
up_write(&nommu_vma_sem);
kfree(vml);
if (vma) {
fput(vma->vm_file);
if (vma->vm_file)
fput(vma->vm_file);
kfree(vma);
}
return ret;
Expand Down

0 comments on commit 3fcd03e

Please sign in to comment.