From 3e5583c105e95f409d9adeb2f379ebc95df625eb Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Thu, 2 Sep 2004 00:39:16 -0700 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 Signed-off-by: Linus Torvalds --- mm/memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memory.c b/mm/memory.c index 8dfcd810f78e..0a7013a26019 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(); -- cgit v1.2.3