diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index e2808586c9e61b3337d70d7954f0c1a16ed5733c..8d204d5a76187ce61b806915782598d82d9bd9e7 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -474,6 +474,8 @@ void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq, struct rpc_wait_queue *queue, struct rpc_task *task) { + if (!RPC_IS_QUEUED(task)) + return; spin_lock_bh(&queue->lock); rpc_wake_up_task_on_wq_queue_locked(wq, queue, task); spin_unlock_bh(&queue->lock); @@ -484,6 +486,8 @@ void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq, */ void rpc_wake_up_queued_task(struct rpc_wait_queue *queue, struct rpc_task *task) { + if (!RPC_IS_QUEUED(task)) + return; spin_lock_bh(&queue->lock); rpc_wake_up_task_queue_locked(queue, task); spin_unlock_bh(&queue->lock);