[PATCH] NOMMU: Don't try and give NULL to fput() From: Gavin Lambert 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 --- mm/nommu.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index fa6850e..1b35ab2 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -949,7 +949,8 @@ #endif 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;