[PATCH] FRV: Fix error handling in is_user_addr_valid()

From: David Howells
Date: Fri Nov 21 2008 - 11:08:26 EST


Fix error handling in is_user_addr_valid() in NOMMU mode to check whether
find_vma() actually worked or not. This checks whether ptrace() is allowed to
access an address.

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
---

arch/frv/kernel/ptrace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index e9af8de..5e7d401 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -83,7 +83,7 @@ static inline int is_user_addr_valid(struct task_struct *child,
struct vm_area_struct *vma;

vma = find_vma(child->mm, start);
- if (start >= vma->vm_start && start + len <= vma->vm_end)
+ if (vma && start >= vma->vm_start && start + len <= vma->vm_end)
return 0;

return -EIO;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/