aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r--net/sunrpc/sched.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index bb12983580a0..d95fe4e40eb4 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -876,9 +876,7 @@ static void rpc_free_task(struct rcu_head *rcu)
876} 876}
877 877
878/* 878/*
879 * Create a new task for the specified client. We have to 879 * Create a new task for the specified client.
880 * clean up after an allocation failure, as the client may
881 * have specified "oneshot".
882 */ 880 */
883struct rpc_task *rpc_new_task(struct rpc_clnt *clnt, int flags, const struct rpc_call_ops *tk_ops, void *calldata) 881struct rpc_task *rpc_new_task(struct rpc_clnt *clnt, int flags, const struct rpc_call_ops *tk_ops, void *calldata)
884{ 882{
@@ -886,7 +884,7 @@ struct rpc_task *rpc_new_task(struct rpc_clnt *clnt, int flags, const struct rpc
886 884
887 task = rpc_alloc_task(); 885 task = rpc_alloc_task();
888 if (!task) 886 if (!task)
889 goto cleanup; 887 goto out;
890 888
891 rpc_init_task(task, clnt, flags, tk_ops, calldata); 889 rpc_init_task(task, clnt, flags, tk_ops, calldata);
892 890
@@ -894,14 +892,6 @@ struct rpc_task *rpc_new_task(struct rpc_clnt *clnt, int flags, const struct rpc
894 task->tk_flags |= RPC_TASK_DYNAMIC; 892 task->tk_flags |= RPC_TASK_DYNAMIC;
895out: 893out:
896 return task; 894 return task;
897
898cleanup:
899 /* Check whether to release the client */
900 if (clnt) {
901 kref_get(&clnt->cl_kref); /* pretend we were used ... */
902 rpc_release_client(clnt);
903 }
904 goto out;
905} 895}
906 896
907 897