aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 18:11:10 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 18:11:10 -0500
commit7a1218a277c45cba1fb8d7089407a1769c645c43 (patch)
treec59634979c53606696993ef06297045015791d6e /net/sunrpc/clnt.c
parent43ac3f2961b8616da26114ec6dc76ac2a61f76ad (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/clnt.c')
-rw-r--r--net/sunrpc/clnt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6e71d6ace5a3..aa8965e9d307 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -495,15 +495,16 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags,
495 int status; 495 int status;
496 496
497 /* If this client is slain all further I/O fails */ 497 /* If this client is slain all further I/O fails */
498 status = -EIO;
498 if (clnt->cl_dead) 499 if (clnt->cl_dead)
499 return -EIO; 500 goto out_release;
500 501
501 flags |= RPC_TASK_ASYNC; 502 flags |= RPC_TASK_ASYNC;
502 503
503 /* Create/initialize a new RPC task */ 504 /* Create/initialize a new RPC task */
504 status = -ENOMEM; 505 status = -ENOMEM;
505 if (!(task = rpc_new_task(clnt, flags, tk_ops, data))) 506 if (!(task = rpc_new_task(clnt, flags, tk_ops, data)))
506 goto out; 507 goto out_release;
507 508
508 /* Mask signals on GSS_AUTH upcalls */ 509 /* Mask signals on GSS_AUTH upcalls */
509 rpc_task_sigmask(task, &oldset); 510 rpc_task_sigmask(task, &oldset);
@@ -518,7 +519,10 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags,
518 rpc_release_task(task); 519 rpc_release_task(task);
519 520
520 rpc_restore_sigmask(&oldset); 521 rpc_restore_sigmask(&oldset);
521out: 522 return status;
523out_release:
524 if (tk_ops->rpc_release != NULL)
525 tk_ops->rpc_release(data);
522 return status; 526 return status;
523} 527}
524 528