Title: [7743] trunk/mm/nommu.c: NOMMU: Don't pass NULL pointers to fput() in do_mmap_pgoff()
Revision
7743
Author
vapier
Date
2009-11-02 06:33:21 -0500 (Mon, 02 Nov 2009)

Log Message

NOMMU: Don't pass NULL pointers to fput() in do_mmap_pgoff()

From: David Howells <[email protected]>

Don't pass NULL pointers to fput() in the error handling paths of the NOMMU
do_mmap_pgoff() as it can't handle it.

Modified Paths

Diff

Modified: trunk/mm/nommu.c (7742 => 7743)


--- trunk/mm/nommu.c	2009-11-02 10:06:07 UTC (rev 7742)
+++ trunk/mm/nommu.c	2009-11-02 11:33:21 UTC (rev 7743)
@@ -1419,9 +1419,11 @@
 error_just_free:
 	up_write(&nommu_region_sem);
 error:
-	fput(region->vm_file);
+	if (region->vm_file)
+		fput(region->vm_file);
 	kmem_cache_free(vm_region_jar, region);
-	fput(vma->vm_file);
+	if (vma->vm_file)
+		fput(vma->vm_file);
 	if (vma->vm_flags & VM_EXECUTABLE)
 		removed_exe_file_vma(vma->vm_mm);
 	kmem_cache_free(vm_area_cachep, vma);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to