The mutex_owned() function was not accounting for the possibility that a lock
might have an owner registered while unlocked.
Orabug:
17624236
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP)
static inline int mutex_owned(struct mutex *lock)
{
- return lock->owner == current;
+ return mutex_is_locked(lock) && lock->owner == current;
}
#else
static inline int mutex_owned(struct mutex *lock)