Skip to contentSkip to conversation

NOMMU: Don't try and give NULL to fput()

PATCH New David Howells 1 participant 1 message Sep 29, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NOMMU: Don't try and give NULL to fput()

From: Gavin Lambert <[email protected]>

Don't try and give NULL to fput() in the error handling in do_mmap_pgoff() as it'll cause an oops.

---

 mm/nommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
mm/nommu.c +2 -1
index 5645406..3650195 100644
@@ -948,7 +948,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;