From: Juri Lelli Date: Wed, 2 Sep 2015 10:01:35 +0000 (+0100) Subject: sched/deadline, locking/rtmutex: Fix open coded check in rt_mutex_waiter_less() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f52405757e4e9bddd868d6b8ca501d58f292969f;p=linux-beck.git sched/deadline, locking/rtmutex: Fix open coded check in rt_mutex_waiter_less() rt_mutex_waiter_less() check of task deadlines is open coded. Since this is subject to wraparound bugs, make it use the correct helper. Reported-by: Luca Abeni Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1441188096-23021-4-git-send-email-juri.lelli@arm.com Signed-off-by: Ingo Molnar --- diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 7781d801212f..35e9bfcc6ad9 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -158,7 +158,8 @@ rt_mutex_waiter_less(struct rt_mutex_waiter *left, * then right waiter has a dl_prio() too. */ if (dl_prio(left->prio)) - return (left->task->dl.deadline < right->task->dl.deadline); + return dl_time_before(left->task->dl.deadline, + right->task->dl.deadline); return 0; }