aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-09 15:42:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:33 -0400
commit07a2bf1da4765d987ffd1d8045e92ba032e0ad78 (patch)
treeaae0eca6d85c75f6a5fb8ac538f1f8e58c7088e2
parent5c9cfc828ae34e19dabbdb9f2861b8c920454047 (diff)
SUNRPC: Fix a memory leak in gss_create()
Fix a memory leak in gss_create() whereby the rpc credcache was not being freed if the rpc_mkpipe() call failed. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 8b4c02f8befb..459dc9b1d1ad 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -636,10 +636,6 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
636 auth->au_flavor = flavor; 636 auth->au_flavor = flavor;
637 atomic_set(&auth->au_count, 1); 637 atomic_set(&auth->au_count, 1);
638 638
639 err = rpcauth_init_credcache(auth, GSS_CRED_EXPIRE);
640 if (err)
641 goto err_put_mech;
642
643 gss_auth->dentry = rpc_mkpipe(clnt->cl_dentry, gss_auth->mech->gm_name, 639 gss_auth->dentry = rpc_mkpipe(clnt->cl_dentry, gss_auth->mech->gm_name,
644 clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN); 640 clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN);
645 if (IS_ERR(gss_auth->dentry)) { 641 if (IS_ERR(gss_auth->dentry)) {
@@ -647,7 +643,13 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
647 goto err_put_mech; 643 goto err_put_mech;
648 } 644 }
649 645
646 err = rpcauth_init_credcache(auth, GSS_CRED_EXPIRE);
647 if (err)
648 goto err_unlink_pipe;
649
650 return auth; 650 return auth;
651err_unlink_pipe:
652 rpc_unlink(gss_auth->dentry);
651err_put_mech: 653err_put_mech:
652 gss_mech_put(gss_auth->mech); 654 gss_mech_put(gss_auth->mech);
653err_free: 655err_free: