|
@@ -231,8 +231,8 @@ int __sched __down_write_common(struct rw_semaphore *sem, int state)
|
|
|
|
|
|
out_nolock:
|
|
|
list_del(&waiter.list);
|
|
|
- if (!list_empty(&sem->wait_list))
|
|
|
- __rwsem_do_wake(sem, 1);
|
|
|
+ if (!list_empty(&sem->wait_list) && sem->count >= 0)
|
|
|
+ __rwsem_do_wake(sem, 0);
|
|
|
raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
|
|
|
|
|
|
return -EINTR;
|