diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 13:16:20 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:03 -0400 |
commit | 5b616f5d596c0b056129f8aeafbc08409b3cd050 (patch) | |
tree | bdbd2eb5bd1f8a26c7287e21be25ec50db075459 /fs/lockd | |
parent | 334ccfd545bba9690515f2c5c167d5adb161989b (diff) |
[PATCH] RPC: Make rpc_create_client() destroy the transport on failure.
This saves us a couple of lines of cleanup code for each call.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/host.c | 4 | ||||
-rw-r--r-- | fs/lockd/mon.c | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 52707c5ad6ea..90a62f27914c 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -193,10 +193,8 @@ nlm_bind_host(struct nlm_host *host) | |||
193 | /* Existing NLM servers accept AUTH_UNIX only */ | 193 | /* Existing NLM servers accept AUTH_UNIX only */ |
194 | clnt = rpc_create_client(xprt, host->h_name, &nlm_program, | 194 | clnt = rpc_create_client(xprt, host->h_name, &nlm_program, |
195 | host->h_version, RPC_AUTH_UNIX); | 195 | host->h_version, RPC_AUTH_UNIX); |
196 | if (IS_ERR(clnt)) { | 196 | if (IS_ERR(clnt)) |
197 | xprt_destroy(xprt); | ||
198 | goto forgetit; | 197 | goto forgetit; |
199 | } | ||
200 | clnt->cl_autobind = 1; /* turn on pmap queries */ | 198 | clnt->cl_autobind = 1; /* turn on pmap queries */ |
201 | xprt->nocong = 1; /* No congestion control for NLM */ | 199 | xprt->nocong = 1; /* No congestion control for NLM */ |
202 | xprt->resvport = 1; /* NLM requires a reserved port */ | 200 | xprt->resvport = 1; /* NLM requires a reserved port */ |
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 6fc1bebeec1d..81b5e7778d70 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -120,15 +120,14 @@ nsm_create(void) | |||
120 | &nsm_program, SM_VERSION, | 120 | &nsm_program, SM_VERSION, |
121 | RPC_AUTH_NULL); | 121 | RPC_AUTH_NULL); |
122 | if (IS_ERR(clnt)) | 122 | if (IS_ERR(clnt)) |
123 | goto out_destroy; | 123 | goto out_err; |
124 | clnt->cl_softrtry = 1; | 124 | clnt->cl_softrtry = 1; |
125 | clnt->cl_chatty = 1; | 125 | clnt->cl_chatty = 1; |
126 | clnt->cl_oneshot = 1; | 126 | clnt->cl_oneshot = 1; |
127 | xprt->resvport = 1; /* NSM requires a reserved port */ | 127 | xprt->resvport = 1; /* NSM requires a reserved port */ |
128 | return clnt; | 128 | return clnt; |
129 | 129 | ||
130 | out_destroy: | 130 | out_err: |
131 | xprt_destroy(xprt); | ||
132 | return clnt; | 131 | return clnt; |
133 | } | 132 | } |
134 | 133 | ||