]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mutex: Fix/document access-once assumption in mutex_can_spin_on_owner()
authorPeter Zijlstra <peterz@infradead.org>
Fri, 19 Jul 2013 18:31:01 +0000 (20:31 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 22 Jul 2013 08:33:39 +0000 (10:33 +0200)
commit1e40c2edef2537f87f94d0baf80aeaeb7d51cc23
tree3692ad447e3242ab2042edfd09d24107d5166652
parentc4be9cb4f19cbd534a6c4c334cd48d8bb483e17a
mutex: Fix/document access-once assumption in mutex_can_spin_on_owner()

mutex_can_spin_on_owner() is technically broken in that it would
in theory allow the compiler to load lock->owner twice, seeing a
pointer first time and a NULL pointer the second time.

Linus pointed out that a compiler has to be seriously broken to
not compile this correctly - but nevertheless this change
is correct as it will better document the implementation.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Acked-by: Waiman Long <Waiman.Long@hp.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Link: http://lkml.kernel.org/r/20130719183101.GA20909@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/mutex.c