diff options
Diffstat (limited to 'kernel/sched/rt.c')
-rw-r--r-- | kernel/sched/rt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 90fa23d36565..1e6b909dca36 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
@@ -2555,6 +2555,8 @@ int sched_group_set_rt_runtime(struct task_group *tg, long rt_runtime_us) | |||
2555 | rt_runtime = (u64)rt_runtime_us * NSEC_PER_USEC; | 2555 | rt_runtime = (u64)rt_runtime_us * NSEC_PER_USEC; |
2556 | if (rt_runtime_us < 0) | 2556 | if (rt_runtime_us < 0) |
2557 | rt_runtime = RUNTIME_INF; | 2557 | rt_runtime = RUNTIME_INF; |
2558 | else if ((u64)rt_runtime_us > U64_MAX / NSEC_PER_USEC) | ||
2559 | return -EINVAL; | ||
2558 | 2560 | ||
2559 | return tg_set_rt_bandwidth(tg, rt_period, rt_runtime); | 2561 | return tg_set_rt_bandwidth(tg, rt_period, rt_runtime); |
2560 | } | 2562 | } |
@@ -2575,6 +2577,9 @@ int sched_group_set_rt_period(struct task_group *tg, u64 rt_period_us) | |||
2575 | { | 2577 | { |
2576 | u64 rt_runtime, rt_period; | 2578 | u64 rt_runtime, rt_period; |
2577 | 2579 | ||
2580 | if (rt_period_us > U64_MAX / NSEC_PER_USEC) | ||
2581 | return -EINVAL; | ||
2582 | |||
2578 | rt_period = rt_period_us * NSEC_PER_USEC; | 2583 | rt_period = rt_period_us * NSEC_PER_USEC; |
2579 | rt_runtime = tg->rt_bandwidth.rt_runtime; | 2584 | rt_runtime = tg->rt_bandwidth.rt_runtime; |
2580 | 2585 | ||