mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] NOMMU: Don't try and give NULL to fput()
@ 2006-09-29  9:35 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2006-09-29  9:35 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, dhowells

From: Gavin Lambert <gavinl@compacsort.com>

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 <dhowells@redhat.com>
---

 mm/nommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index 5645406..3650195 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-29  9:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29  9:35 [PATCH] NOMMU: Don't try and give NULL to fput() David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®