aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-11-03 15:56:53 -0700
committerBrian Behlendorf <[email protected]>2010-11-05 11:52:30 -0700
commit8294c69bb759d2a4dc2e73f164cb37c297722ada (patch)
tree35a6fb0c94f2f0b35e9682ed1efcfd67151010f7 /include
parent23aa63cbf5e712493d9439f888e426f89bb97857 (diff)
Clear owner after dropping mutex
It's important to clear mp->owner after calling mutex_unlock() because when CONFIG_DEBUG_MUTEXES is defined the mutex owner is verified in mutex_unlock(). If we set it to NULL this check fails and the lockdep support is immediately disabled.
Diffstat (limited to 'include')
-rw-r--r--include/sys/mutex.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/mutex.h b/include/sys/mutex.h
index 97f49cb2a..1a8b25813 100644
--- a/include/sys/mutex.h
+++ b/include/sys/mutex.h
@@ -81,8 +81,8 @@ mutex_owned(kmutex_t *mp)
#ifdef CONFIG_DEBUG_MUTEXES
# define mutex_exit(mp) \
({ \
- (mp)->owner = NULL; \
- mutex_unlock(mp); \
+ mutex_unlock(mp); \
+ (mp)->owner = NULL; \
})
#else
# define mutex_exit(mp) mutex_unlock(mp)