Merge remote-tracking branch 'asoc/fix/davinci' into asoc-linus
[deliverable/linux.git] / lib / rwsem.c
index cf0ad2ad19f5a999bb688df8edc4433e4e174832..19c5fa95e0b4d7d06587d5fc5feb2ff0295f1efe 100644 (file)
@@ -223,7 +223,9 @@ struct rw_semaphore __sched *rwsem_down_write_failed(struct rw_semaphore *sem)
                        count = RWSEM_ACTIVE_WRITE_BIAS;
                        if (!list_is_singular(&sem->wait_list))
                                count += RWSEM_WAITING_BIAS;
-                       if (cmpxchg(&sem->count, RWSEM_WAITING_BIAS, count) ==
+
+                       if (sem->count == RWSEM_WAITING_BIAS &&
+                           cmpxchg(&sem->count, RWSEM_WAITING_BIAS, count) ==
                                                        RWSEM_WAITING_BIAS)
                                break;
                }
This page took 0.028931 seconds and 5 git commands to generate.