aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2004-09-02 00:39:16 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-02 00:39:16 -0700
commit3e5583c105e95f409d9adeb2f379ebc95df625eb (patch)
treedf916300cded045bf7d0a9c988f722d09e364f10 /mm
parent6ff6872590dc7a4d87921eb6d47a0d3f82d599c4 (diff)
downloadhistory-3e5583c105e95f409d9adeb2f379ebc95df625eb.tar.gz
[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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 8dfcd810f78e2a..0a7013a26019e9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1744,6 +1744,8 @@ int make_pages_present(unsigned long addr, unsigned long end)
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();