Prev: [PATCH 2/4] rtmutex: add BUG_ON if a task attempts to block on two locks
Next: [PATCH 3/4] futex: free_pi_state outside of hb->lock sections
From: Darren Hart on 9 Jul 2010 18:40 If the pi_blocked_on variable is NULL, the subsequent WARN_ON's will cause an OOPS. Only perform the susequent checks if pi_blocked_on is valid. Signed-off-by: Darren Hart <dvhltc(a)us.ibm.com> Cc: Thomas Gleixner <tglx(a)linutronix.de> Cc: Peter Zijlstra <peterz(a)infradead.org> Cc: Ingo Molnar <mingo(a)elte.hu> Cc: Eric Dumazet <eric.dumazet(a)gmail.com> Cc: John Kacur <jkacur(a)redhat.com> Cc: Steven Rostedt <rostedt(a)goodmis.org> Cc: Mike Galbraith <efault(a)gmx.de> --- kernel/rtmutex.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c index 23dd443..baac7d9 100644 --- a/kernel/rtmutex.c +++ b/kernel/rtmutex.c @@ -579,9 +579,10 @@ static void wakeup_next_waiter(struct rt_mutex *lock, int savestate) raw_spin_lock(&pendowner->pi_lock); - WARN_ON(!pendowner->pi_blocked_on); - WARN_ON(pendowner->pi_blocked_on != waiter); - WARN_ON(pendowner->pi_blocked_on->lock != lock); + if (!WARN_ON(!pendowner->pi_blocked_on)) { + WARN_ON(pendowner->pi_blocked_on != waiter); + WARN_ON(pendowner->pi_blocked_on->lock != lock); + } pendowner->pi_blocked_on = NULL; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |