aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c4
-rw-r--r--kernel/sched.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 039baa4cd90c..66103a119bfe 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1037,8 +1037,8 @@ int current_cpuset_is_being_rebound(void)
1037 1037
1038static int update_relax_domain_level(struct cpuset *cs, s64 val) 1038static int update_relax_domain_level(struct cpuset *cs, s64 val)
1039{ 1039{
1040 if ((int)val < 0) 1040 if (val < -1 || val >= SD_LV_MAX)
1041 val = -1; 1041 return -EINVAL;
1042 1042
1043 if (val != cs->relax_domain_level) { 1043 if (val != cs->relax_domain_level) {
1044 cs->relax_domain_level = val; 1044 cs->relax_domain_level = val;
diff --git a/kernel/sched.c b/kernel/sched.c
index eaf6751e7612..bb2c699c9f5e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6877,7 +6877,12 @@ static int default_relax_domain_level = -1;
6877 6877
6878static int __init setup_relax_domain_level(char *str) 6878static int __init setup_relax_domain_level(char *str)
6879{ 6879{
6880 default_relax_domain_level = simple_strtoul(str, NULL, 0); 6880 unsigned long val;
6881
6882 val = simple_strtoul(str, NULL, 0);
6883 if (val < SD_LV_MAX)
6884 default_relax_domain_level = val;
6885
6881 return 1; 6886 return 1;
6882} 6887}
6883__setup("relax_domain_level=", setup_relax_domain_level); 6888__setup("relax_domain_level=", setup_relax_domain_level);