diff options
author | Dave Jones <davej@redhat.com> | 2004-09-02 00:39:16 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-02 00:39:16 -0700 |
commit | 3e5583c105e95f409d9adeb2f379ebc95df625eb (patch) | |
tree | df916300cded045bf7d0a9c988f722d09e364f10 /mm | |
parent | 6ff6872590dc7a4d87921eb6d47a0d3f82d599c4 (diff) | |
download | history-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.c | 2 |
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(); |