summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/ptrace.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-05-01 08:59:14 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:59:14 -0700
commit7ed20e1ad521b5f5df61bf6559ae60738e393741 (patch)
tree90931724e45eaedb3445314e8b94e78253642395 /arch/parisc/kernel/ptrace.c
parente5bdd883a189243541e7a132385580703b049102 (diff)
downloadlinux-stable-7ed20e1ad521b5f5df61bf6559ae60738e393741.tar.gz
linux-stable-7ed20e1ad521b5f5df61bf6559ae60738e393741.tar.bz2
linux-stable-7ed20e1ad521b5f5df61bf6559ae60738e393741.zip
[PATCH] convert that currently tests _NSIG directly to use valid_signal()
Convert most of the current code that uses _NSIG directly to instead use valid_signal(). This avoids gcc -W warnings and off-by-one errors. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/parisc/kernel/ptrace.c')
-rw-r--r--arch/parisc/kernel/ptrace.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 2937a9236384..c07db9dff7cd 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -17,6 +17,7 @@
#include <linux/personality.h>
#include <linux/security.h>
#include <linux/compat.h>
+#include <linux/signal.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -285,7 +286,7 @@ long sys_ptrace(long request, pid_t pid, long addr, long data)
ret = -EIO;
DBG("sys_ptrace(%s)\n",
request == PTRACE_SYSCALL ? "SYSCALL" : "CONT");
- if ((unsigned long) data > _NSIG)
+ if (!valid_signal(data))
goto out_tsk;
child->ptrace &= ~(PT_SINGLESTEP|PT_BLOCKSTEP);
if (request == PTRACE_SYSCALL) {
@@ -311,7 +312,7 @@ long sys_ptrace(long request, pid_t pid, long addr, long data)
case PTRACE_SINGLEBLOCK:
DBG("sys_ptrace(SINGLEBLOCK)\n");
ret = -EIO;
- if ((unsigned long) data > _NSIG)
+ if (!valid_signal(data))
goto out_tsk;
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->ptrace &= ~PT_SINGLESTEP;
@@ -328,7 +329,7 @@ long sys_ptrace(long request, pid_t pid, long addr, long data)
case PTRACE_SINGLESTEP:
DBG("sys_ptrace(SINGLESTEP)\n");
ret = -EIO;
- if ((unsigned long) data > _NSIG)
+ if (!valid_signal(data))
goto out_tsk;
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);