aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 13:16:20 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 16:07:03 -0400
commit5b616f5d596c0b056129f8aeafbc08409b3cd050 (patch)
treebdbd2eb5bd1f8a26c7287e21be25ec50db075459 /net/sunrpc
parent334ccfd545bba9690515f2c5c167d5adb161989b (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 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c1
-rw-r--r--net/sunrpc/pmap_clnt.c4
-rw-r--r--net/sunrpc/sunrpc_syms.c1
3 files changed, 2 insertions, 4 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 209aaf595695..99515d7727a6 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -178,6 +178,7 @@ out_no_path:
178 kfree(clnt->cl_server); 178 kfree(clnt->cl_server);
179 kfree(clnt); 179 kfree(clnt);
180out_err: 180out_err:
181 xprt_destroy(xprt);
181 return ERR_PTR(err); 182 return ERR_PTR(err);
182} 183}
183 184
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index d0b1d2c34a4d..97c420ff1ee0 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -210,9 +210,7 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto)
210 clnt = rpc_create_client(xprt, hostname, 210 clnt = rpc_create_client(xprt, hostname,
211 &pmap_program, RPC_PMAP_VERSION, 211 &pmap_program, RPC_PMAP_VERSION,
212 RPC_AUTH_UNIX); 212 RPC_AUTH_UNIX);
213 if (IS_ERR(clnt)) { 213 if (!IS_ERR(clnt)) {
214 xprt_destroy(xprt);
215 } else {
216 clnt->cl_softrtry = 1; 214 clnt->cl_softrtry = 1;
217 clnt->cl_chatty = 1; 215 clnt->cl_chatty = 1;
218 clnt->cl_oneshot = 1; 216 clnt->cl_oneshot = 1;
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index d4f26bf9e732..1b0ff7e0e869 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -61,7 +61,6 @@ EXPORT_SYMBOL(rpc_mkpipe);
61 61
62/* Client transport */ 62/* Client transport */
63EXPORT_SYMBOL(xprt_create_proto); 63EXPORT_SYMBOL(xprt_create_proto);
64EXPORT_SYMBOL(xprt_destroy);
65EXPORT_SYMBOL(xprt_set_timeout); 64EXPORT_SYMBOL(xprt_set_timeout);
66EXPORT_SYMBOL(xprt_udp_slot_table_entries); 65EXPORT_SYMBOL(xprt_udp_slot_table_entries);
67EXPORT_SYMBOL(xprt_tcp_slot_table_entries); 66EXPORT_SYMBOL(xprt_tcp_slot_table_entries);