Commit 3e5583c1 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[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: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6ff68725
...@@ -1744,6 +1744,8 @@ int make_pages_present(unsigned long addr, unsigned long end) ...@@ -1744,6 +1744,8 @@ int make_pages_present(unsigned long addr, unsigned long end)
struct vm_area_struct * vma; struct vm_area_struct * vma;
vma = find_vma(current->mm, addr); vma = find_vma(current->mm, addr);
if (!vma)
return -1;
write = (vma->vm_flags & VM_WRITE) != 0; write = (vma->vm_flags & VM_WRITE) != 0;
if (addr >= end) if (addr >= end)
BUG(); BUG();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment