]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Check find_vma return code in make_pages_present()
authorDave Jones <davej@redhat.com>
Thu, 2 Sep 2004 07:39:16 +0000 (00:39 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 2 Sep 2004 07:39:16 +0000 (00:39 -0700)
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>
mm/memory.c

index 8dfcd810f78e2a317a1e3f4462a20264e0832228..0a7013a26019e9760894bb28b1a5c096cac90b7d 100644 (file)
@@ -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();