aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/rwsem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rwsem.c b/lib/rwsem.c
index cf0ad2ad19f5..19c5fa95e0b4 100644
--- a/lib/rwsem.c
+++ b/lib/rwsem.c
@@ -223,7 +223,9 @@ struct rw_semaphore __sched *rwsem_down_write_failed(struct rw_semaphore *sem)
223 count = RWSEM_ACTIVE_WRITE_BIAS; 223 count = RWSEM_ACTIVE_WRITE_BIAS;
224 if (!list_is_singular(&sem->wait_list)) 224 if (!list_is_singular(&sem->wait_list))
225 count += RWSEM_WAITING_BIAS; 225 count += RWSEM_WAITING_BIAS;
226 if (cmpxchg(&sem->count, RWSEM_WAITING_BIAS, count) == 226
227 if (sem->count == RWSEM_WAITING_BIAS &&
228 cmpxchg(&sem->count, RWSEM_WAITING_BIAS, count) ==
227 RWSEM_WAITING_BIAS) 229 RWSEM_WAITING_BIAS)
228 break; 230 break;
229 } 231 }