cpuset: limit the input of cpuset.sched_relax_domain_level

We allow the inputs to be [-1 ... SD_LV_MAX), and return -EINVAL
for inputs outside this range.

Signed-off-by: Li Zefan <[email protected]>
Acked-by: Paul Menage <[email protected]>
Acked-by: Paul Jackson <[email protected]>
Acked-by: Hidetoshi Seto <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
Li Zefan 2008-05-13 10:27:17 +08:00 • committed by Ingo Molnar
commit 30e0e17819
3 changed files with 9 additions and 4 deletions

View file

@ -1037,8 +1037,8 @@ int current_cpuset_is_being_rebound(void)
static int update_relax_domain_level(struct cpuset *cs, s64 val)
{
if ((int)val < 0)
val = -1;
if (val < -1 || val >= SD_LV_MAX)
return -EINVAL;
if (val != cs->relax_domain_level) {
cs->relax_domain_level = val;