Commit 1e6c3e8f8fb94a8914a380e02a7e8ad81d47273e
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Ingo Molnar: "A liblockdep fix and a mutex_unlock() mutex-debugging fix" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: mutex: Always clear owner field upon mutex_unlock() tools/liblockdep: Fix debug_check thinko in mutex destroy
Showing 2 changed files Side-by-side Diff
kernel/locking/mutex-debug.c
... | ... | @@ -80,13 +80,13 @@ |
80 | 80 | DEBUG_LOCKS_WARN_ON(lock->owner != current); |
81 | 81 | |
82 | 82 | DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next); |
83 | - mutex_clear_owner(lock); | |
84 | 83 | } |
85 | 84 | |
86 | 85 | /* |
87 | 86 | * __mutex_slowpath_needs_to_unlock() is explicitly 0 for debug |
88 | 87 | * mutexes so that we can do it here after we've verified state. |
89 | 88 | */ |
89 | + mutex_clear_owner(lock); | |
90 | 90 | atomic_set(&lock->count, 1); |
91 | 91 | } |
92 | 92 |
tools/lib/lockdep/preload.c
... | ... | @@ -317,7 +317,7 @@ |
317 | 317 | * |
318 | 318 | * TODO: Hook into free() and add that check there as well. |
319 | 319 | */ |
320 | - debug_check_no_locks_freed(mutex, mutex + sizeof(*mutex)); | |
320 | + debug_check_no_locks_freed(mutex, sizeof(*mutex)); | |
321 | 321 | __del_lock(__get_lock(mutex)); |
322 | 322 | return ll_pthread_mutex_destroy(mutex); |
323 | 323 | } |
... | ... | @@ -341,7 +341,7 @@ |
341 | 341 | { |
342 | 342 | try_init_preload(); |
343 | 343 | |
344 | - debug_check_no_locks_freed(rwlock, rwlock + sizeof(*rwlock)); | |
344 | + debug_check_no_locks_freed(rwlock, sizeof(*rwlock)); | |
345 | 345 | __del_lock(__get_lock(rwlock)); |
346 | 346 | return ll_pthread_rwlock_destroy(rwlock); |
347 | 347 | } |