sched_getaffinity(): return EINVAL for 0 lenght request (fixes LTP sched_getaffinity01)

This commit is contained in:
Balazs Gerofi
2015-07-10 11:00:43 +09:00
parent 7647c99cc2
commit f7d78c8b7d

View File

@@ -4832,6 +4832,9 @@ SYSCALL_DECLARE(sched_getaffinity)
unsigned long irqstate;
extern int num_processors;
if (!len)
return -EINVAL;
len = MIN2(len, sizeof(k_cpu_set));
if(tid == 0)