lib/rwsem.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/rwsem.c b/lib/rwsem.c index 410aa1189b13..7afb403918da 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c @@ -92,10 +92,9 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wake_type) */ list_del(&waiter->list); tsk = waiter->task; + wake_up_process(tsk); smp_mb(); waiter->task = NULL; - wake_up_process(tsk); - put_task_struct(tsk); goto out; readers_only: @@ -146,10 +145,9 @@ __rwsem_do_wake(struct rw_semaphore *sem, int wake_type) waiter = list_entry(next, struct rwsem_waiter, list); next = waiter->list.next; tsk = waiter->task; + wake_up_process(tsk); smp_mb(); waiter->task = NULL; - wake_up_process(tsk); - put_task_struct(tsk); } sem->wait_list.next = next; @@ -183,7 +181,6 @@ rwsem_down_failed_common(struct rw_semaphore *sem, raw_spin_lock_irq(&sem->wait_lock); waiter.task = tsk; waiter.flags = flags; - get_task_struct(tsk); if (list_empty(&sem->wait_list)) adjustment += RWSEM_WAITING_BIAS; @@ -211,11 +208,8 @@ rwsem_down_failed_common(struct rw_semaphore *sem, if (!waiter.task) break; schedule(); - set_task_state(tsk, TASK_UNINTERRUPTIBLE); } - tsk->state = TASK_RUNNING; - return sem; }