lkml.org 
[lkml]   [2004]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Check find_vma return code in make_pages_present()
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();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.039 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site