summaryrefslogtreecommitdiffstats
path: root/kernel/locking/mutex-debug.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-04-28 12:00:36 +0200
committerTakashi Iwai <tiwai@suse.de>2014-04-28 12:00:36 +0200
commit474a59610729a178cd3c9a6ab990da770b856c74 (patch)
tree4b2967dee40ee4d7269fd0b2c59088b4d9bc1286 /kernel/locking/mutex-debug.c
parent8dc9abb93dde94e7f2bc719032fe16f5713df05c (diff)
parent98810a6dcf8af768d7b0b71e5075ff9c199f5196 (diff)
Merge tag 'asoc-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.15 A smattering of driver-specific fixes here, nothing generic. The Cirrus CODEC conversions to devm_ are leak fixes - the conversion adds missing error handling code.
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