[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>
This commit is contained in:
committed by
Linus Torvalds
parent
e5bdd883a1
commit
7ed20e1ad5
@@ -25,6 +25,7 @@
|
||||
#include <linux/dcookies.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/signal.h>
|
||||
|
||||
#include <linux/compat.h>
|
||||
#include <linux/syscalls.h>
|
||||
@@ -1637,7 +1638,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
switch (option) {
|
||||
case PR_SET_PDEATHSIG:
|
||||
sig = arg2;
|
||||
if (sig < 0 || sig > _NSIG) {
|
||||
if (!valid_signal(sig)) {
|
||||
error = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user