diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 528a10592c16..6af210a7de70 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include <linux/debugfs.h> | 71 | #include <linux/debugfs.h> |
72 | #include <linux/ctype.h> | 72 | #include <linux/ctype.h> |
73 | #include <linux/ftrace.h> | 73 | #include <linux/ftrace.h> |
74 | #include <linux/slab.h> | ||
74 | 75 | ||
75 | #include <asm/tlb.h> | 76 | #include <asm/tlb.h> |
76 | #include <asm/irq_regs.h> | 77 | #include <asm/irq_regs.h> |
@@ -4902,7 +4903,7 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, | |||
4902 | int ret; | 4903 | int ret; |
4903 | cpumask_var_t mask; | 4904 | cpumask_var_t mask; |
4904 | 4905 | ||
4905 | if (len < nr_cpu_ids) | 4906 | if ((len * BITS_PER_BYTE) < nr_cpu_ids) |
4906 | return -EINVAL; | 4907 | return -EINVAL; |
4907 | if (len & (sizeof(unsigned long)-1)) | 4908 | if (len & (sizeof(unsigned long)-1)) |
4908 | return -EINVAL; | 4909 | return -EINVAL; |