diff options
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r-- | net/sunrpc/sched.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index aae6907fd54..c8979ce5d88 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -856,16 +856,23 @@ struct rpc_task *rpc_new_task(const struct rpc_task_setup *setup_data) | |||
856 | 856 | ||
857 | if (task == NULL) { | 857 | if (task == NULL) { |
858 | task = rpc_alloc_task(); | 858 | task = rpc_alloc_task(); |
859 | if (task == NULL) | 859 | if (task == NULL) { |
860 | goto out; | 860 | rpc_release_calldata(setup_data->callback_ops, |
861 | setup_data->callback_data); | ||
862 | return ERR_PTR(-ENOMEM); | ||
863 | } | ||
861 | flags = RPC_TASK_DYNAMIC; | 864 | flags = RPC_TASK_DYNAMIC; |
862 | } | 865 | } |
863 | 866 | ||
864 | rpc_init_task(task, setup_data); | 867 | rpc_init_task(task, setup_data); |
868 | if (task->tk_status < 0) { | ||
869 | int err = task->tk_status; | ||
870 | rpc_put_task(task); | ||
871 | return ERR_PTR(err); | ||
872 | } | ||
865 | 873 | ||
866 | task->tk_flags |= flags; | 874 | task->tk_flags |= flags; |
867 | dprintk("RPC: allocated task %p\n", task); | 875 | dprintk("RPC: allocated task %p\n", task); |
868 | out: | ||
869 | return task; | 876 | return task; |
870 | } | 877 | } |
871 | 878 | ||