sched: Make sure that affinity mask is valid
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
af19a22b11
commit
855060f353
1 changed files with 7 additions and 0 deletions
|
@ -78,6 +78,13 @@ int nxsched_set_affinity(pid_t pid, size_t cpusetsize,
|
|||
|
||||
DEBUGASSERT(cpusetsize == sizeof(cpu_set_t) && mask != NULL);
|
||||
|
||||
/* Make sure that affinity mask is valid */
|
||||
|
||||
if (*mask == 0)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Verify that the PID corresponds to a real task */
|
||||
|
||||
if (!pid)
|
||||
|
|
Loading…
Reference in a new issue