Merge branch 'perf/urgent' into perf/core
Conflicts: arch/x86/kernel/cpu/perf_event.c Merge reason: Resolve the conflict, pick up fixes Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@ -2607,7 +2607,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct rq *rq;
|
||||
int cpu = get_cpu();
|
||||
int cpu __maybe_unused = get_cpu();
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/*
|
||||
@ -4859,7 +4859,9 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
|
||||
int ret;
|
||||
cpumask_var_t mask;
|
||||
|
||||
if (len < cpumask_size())
|
||||
if (len < nr_cpu_ids)
|
||||
return -EINVAL;
|
||||
if (len & (sizeof(unsigned long)-1))
|
||||
return -EINVAL;
|
||||
|
||||
if (!alloc_cpumask_var(&mask, GFP_KERNEL))
|
||||
@ -4867,10 +4869,12 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
|
||||
|
||||
ret = sched_getaffinity(pid, mask);
|
||||
if (ret == 0) {
|
||||
if (copy_to_user(user_mask_ptr, mask, cpumask_size()))
|
||||
size_t retlen = min_t(size_t, len, cpumask_size());
|
||||
|
||||
if (copy_to_user(user_mask_ptr, mask, retlen))
|
||||
ret = -EFAULT;
|
||||
else
|
||||
ret = cpumask_size();
|
||||
ret = retlen;
|
||||
}
|
||||
free_cpumask_var(mask);
|
||||
|
||||
|
Reference in New Issue
Block a user