summary refs log tree commit diff
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-05-13 10:27:17 +0800
committerIngo Molnar <mingo@elte.hu>2008-06-19 09:45:36 +0200
commit30e0e178193d4221abc9926b07a4c7661c7cc4a9 (patch)
treef6ad7d54e810a97345ad82b55832a2dbfb3ca6e2 /kernel/cpuset.c
parent9bedbcb207ed9a571b239231d99c8fd4a34ae24d (diff)
downloadlinux-30e0e178193d4221abc9926b07a4c7661c7cc4a9.tar.gz
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 <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Acked-by: Paul Jackson <pj@sgi.com>
Acked-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c4
1 files changed, 2 insertions, 2 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)
 
 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;