diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 18:11:10 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 18:11:10 -0500 |
commit | 7a1218a277c45cba1fb8d7089407a1769c645c43 (patch) | |
tree | c59634979c53606696993ef06297045015791d6e /net/sunrpc/sched.c | |
parent | 43ac3f2961b8616da26114ec6dc76ac2a61f76ad (diff) |
SUNRPC: Ensure rpc_call_async() always calls tk_ops->rpc_release()
Currently this will not happen if we exit before rpc_new_task() was called.
Also fix up rpc_run_task() to do the same (for consistency).
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r-- | net/sunrpc/sched.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index cd51b5468332..3fc13bea302d 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -921,8 +921,11 @@ struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, | |||
921 | { | 921 | { |
922 | struct rpc_task *task; | 922 | struct rpc_task *task; |
923 | task = rpc_new_task(clnt, flags, ops, data); | 923 | task = rpc_new_task(clnt, flags, ops, data); |
924 | if (task == NULL) | 924 | if (task == NULL) { |
925 | if (ops->rpc_release != NULL) | ||
926 | ops->rpc_release(data); | ||
925 | return ERR_PTR(-ENOMEM); | 927 | return ERR_PTR(-ENOMEM); |
928 | } | ||
926 | atomic_inc(&task->tk_count); | 929 | atomic_inc(&task->tk_count); |
927 | rpc_execute(task); | 930 | rpc_execute(task); |
928 | return task; | 931 | return task; |