summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-03 05:28:42 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-03 05:28:42 -0700
commit6560092a8ed3332e7d87e1155871b88ad070809a (patch)
treea5e936e9e8d0d9944d76fdc4d9fcb190199e47a7 /kernel
parentc3272d7c12a2157f8fe96cee615da30af94814bc (diff)
Remove extra tests from get_user_cpu_mask().
They aren't internally consistent.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 915a794079b2..e0bf1ebab65e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3366,25 +3366,8 @@ static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len,
cpumask_t *new_mask)
{
if (len < sizeof(cpumask_t)) {
- /* Smaller is ok as long as all online CPUs are covered */
- int i, max = 0;
- for_each_online_cpu(i)
- max = i;
- if (len < (max + 7)/8)
- return -EINVAL;
memset(new_mask, 0, sizeof(cpumask_t));
} else if (len > sizeof(cpumask_t)) {
- /* Longer is ok as long as all high bits are 0 */
- int i;
- if (len > PAGE_SIZE)
- return -EINVAL;
- for (i = sizeof(cpumask_t); i < len; i++) {
- unsigned char val;
- if (get_user(val, (unsigned char *)user_mask_ptr + i))
- return -EFAULT;
- if (val)
- return -EINVAL;
- }
len = sizeof(cpumask_t);
}
return copy_from_user(new_mask, user_mask_ptr, len) ? -EFAULT : 0;