All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Check find_vma return code in make_pages_present()
@ 2004-09-01 15:51 Dave Jones
  0 siblings, 0 replies; only message in thread
From: Dave Jones @ 2004-09-01 15:51 UTC (permalink / raw)
  To: linux-kernel

It can return NULL, so check for it.

Spotted with the source checker from Coverity.com.

Signed-off-by: Dave Jones <davej@redhat.com>


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/mm/memory.c linux-2.6/mm/memory.c
--- bk-linus/mm/memory.c	2004-08-24 00:02:41.000000000 +0100
+++ linux-2.6/mm/memory.c	2004-09-01 13:31:18.000000000 +0100
@@ -1744,6 +1744,8 @@ int make_pages_present(unsigned long add
 	struct vm_area_struct * vma;
 
 	vma = find_vma(current->mm, addr);
+	if (!vma)
+		return -1;
 	write = (vma->vm_flags & VM_WRITE) != 0;
 	if (addr >= end)
 		BUG();

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

only message in thread, other threads:[~2004-09-01 16:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-01 15:51 [PATCH] Check find_vma return code in make_pages_present() Dave Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.