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

@ -6877,7 +6877,12 @@ static int default_relax_domain_level = -1;
static int __init setup_relax_domain_level(char *str)
{
default_relax_domain_level = simple_strtoul(str, NULL, 0);
unsigned long val;
val = simple_strtoul(str, NULL, 0);
if (val < SD_LV_MAX)
default_relax_domain_level = val;
return 1;
}
__setup("relax_domain_level=", setup_relax_domain_level);