summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/mutex_32.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-07-27 12:35:35 +0200
committerIngo Molnar <mingo@kernel.org>2016-07-27 12:35:35 +0200
commitdf15929f8f5c69e987c31bf016eca4a38dba46f0 (patch)
treecfb5fe5e8ebff4cabd70557a304f355546943cc9 /arch/x86/include/asm/mutex_32.h
parentefaad554b4ffae1840a2759e09e21325ddbc8b05 (diff)
parent37e13a1ebe32c4fbfbdb5413f42eb6e71d8b28a4 (diff)
downloadlinux-df15929f8f5c69e987c31bf016eca4a38dba46f0.tar.bz2
Merge branch 'linus' into x86/microcode, to pick up merge window changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/mutex_32.h')
-rw-r--r--arch/x86/include/asm/mutex_32.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/mutex_32.h b/arch/x86/include/asm/mutex_32.h
index 85e6cda45a02..e9355a84fc67 100644
--- a/arch/x86/include/asm/mutex_32.h
+++ b/arch/x86/include/asm/mutex_32.h
@@ -101,7 +101,7 @@ static inline int __mutex_fastpath_trylock(atomic_t *count,
int (*fail_fn)(atomic_t *))
{
/* cmpxchg because it never induces a false contention state. */
- if (likely(atomic_cmpxchg(count, 1, 0) == 1))
+ if (likely(atomic_read(count) == 1 && atomic_cmpxchg(count, 1, 0) == 1))
return 1;
return 0;