Skip to content
Commit 833c58ef authored by Pierre Gondois's avatar Pierre Gondois
Browse files

sched/fair: Fix integer underflow



(struct sg_lb_stats).idle_cpus is of type 'unsigned int'.
(local->idle_cpus - busiest->idle_cpus) can underflow to UINT_MAX
for instance, and max_t(long, 0, UINT_MAX) will output UINT_MAX.

Use lsub_positive() instead of max_t().

Fixes: 16b0a7a1 ("sched/fair: Ensure tasks spreading in LLC during LB")
cc: stable@vger.kernel.org
Signed-off-by: Pierre Gondois's avatarPierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Vincent Guittot's avatarVincent Guittot <vincent.guittot@linaro.org>
parent 0b2653d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment