diff options
-rw-r--r-- | kernel/sys.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index ec319bbb0bd4..df4c3a8f5df9 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/prctl.h> | 14 | #include <linux/prctl.h> |
15 | #include <linux/highuid.h> | 15 | #include <linux/highuid.h> |
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <linux/resource.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/kexec.h> | 19 | #include <linux/kexec.h> |
19 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
@@ -659,7 +660,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval) | |||
659 | int error = -EINVAL; | 660 | int error = -EINVAL; |
660 | struct pid *pgrp; | 661 | struct pid *pgrp; |
661 | 662 | ||
662 | if (which > 2 || which < 0) | 663 | if (which > PRIO_USER || which < PRIO_PROCESS) |
663 | goto out; | 664 | goto out; |
664 | 665 | ||
665 | /* normalize: avoid signed division (rounding problems) */ | 666 | /* normalize: avoid signed division (rounding problems) */ |
@@ -723,7 +724,7 @@ asmlinkage long sys_getpriority(int which, int who) | |||
723 | long niceval, retval = -ESRCH; | 724 | long niceval, retval = -ESRCH; |
724 | struct pid *pgrp; | 725 | struct pid *pgrp; |
725 | 726 | ||
726 | if (which > 2 || which < 0) | 727 | if (which > PRIO_USER || which < PRIO_PROCESS) |
727 | return -EINVAL; | 728 | return -EINVAL; |
728 | 729 | ||
729 | read_lock(&tasklist_lock); | 730 | read_lock(&tasklist_lock); |