summaryrefslogtreecommitdiffstats
path: root/kernel/locking/mutex-debug.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-04-18 12:14:55 +0200
committerIngo Molnar <mingo@kernel.org>2014-04-18 12:14:55 +0200
commit1111b680d34bc19190f02a1b4479c3fcc592c22e (patch)
tree9d45ad88b9354205a2d1fd76a338ab8693a16d86 /kernel/locking/mutex-debug.c
parent37b6cb475a6d74bc047c53bc323d6eb3113e27a4 (diff)
parent24223657806a0ebd0ae5c9caaf7b021091889cf2 (diff)
Merge branch 'perf/urgent' into perf/core, to pick up PMU driver fixes.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/locking/mutex-debug.c')
-rw-r--r--kernel/locking/mutex-debug.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/locking/mutex-debug.c b/kernel/locking/mutex-debug.c
index e1191c996c5..5cf6731b98e 100644
--- a/kernel/locking/mutex-debug.c
+++ b/kernel/locking/mutex-debug.c
@@ -71,18 +71,17 @@ void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
void debug_mutex_unlock(struct mutex *lock)
{
- if (unlikely(!debug_locks))
- return;
+ if (likely(debug_locks)) {
+ DEBUG_LOCKS_WARN_ON(lock->magic != lock);
- DEBUG_LOCKS_WARN_ON(lock->magic != lock);
+ if (!lock->owner)
+ DEBUG_LOCKS_WARN_ON(!lock->owner);
+ else
+ DEBUG_LOCKS_WARN_ON(lock->owner != current);
- if (!lock->owner)
- DEBUG_LOCKS_WARN_ON(!lock->owner);
- else
- DEBUG_LOCKS_WARN_ON(lock->owner != current);
-
- DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
- mutex_clear_owner(lock);
+ DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
+ mutex_clear_owner(lock);
+ }
/*
* __mutex_slowpath_needs_to_unlock() is explicitly 0 for debug