summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-03 04:12:53 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-03 04:12:53 +0200
commitb2a4a7ce3a995b83f59792ec9981d20ac550ccb0 (patch)
treec0da7c9bd4b9ef5ea01e81723722447f950a30ed
parentMerge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 (diff)
parentsched: fix divide error when trying to configure rt_period to zero (diff)
downloadlinux-b2a4a7ce3a995b83f59792ec9981d20ac550ccb0.tar.xz
linux-b2a4a7ce3a995b83f59792ec9981d20ac550ccb0.zip
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched: fix divide error when trying to configure rt_period to zero
-rw-r--r--kernel/sched.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index a66e85639de2..94ead43eda62 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8502,6 +8502,9 @@ int sched_group_set_rt_period(struct task_group *tg, long rt_period_us)
rt_period = (u64)rt_period_us * NSEC_PER_USEC;
rt_runtime = tg->rt_bandwidth.rt_runtime;
+ if (rt_period == 0)
+ return -EINVAL;
+
return tg_set_bandwidth(tg, rt_period, rt_runtime);
}