mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] fix sched_setscheduler semantics
Currently, a negative policy argument passed into the
'sys_sched_setscheduler()' system call, will return with success. However,
the manpage for 'sys_sched_setscheduler' says:
EINVAL The scheduling policy is not one of the recognized policies, or the
parameter p does not make sense for the policy.
Signed-off-by: Jason Baron <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
147b31cf09
commit
c21761f168
1 changed files with 4 additions and 0 deletions
|
|
@ -3850,6 +3850,10 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
|
|||
asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
|
||||
struct sched_param __user *param)
|
||||
{
|
||||
/* negative values for policy are not valid */
|
||||
if (policy < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return do_sched_setscheduler(pid, policy, param);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue