Commit ecaf2944 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: cbnull refcount leak

Properly decrement refcount on failure in nfsd4_probe_callback.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4cdabcbe
...@@ -434,7 +434,6 @@ nfsd4_probe_callback(struct nfs4_client *clp) ...@@ -434,7 +434,6 @@ nfsd4_probe_callback(struct nfs4_client *clp)
clnt->cl_intr = 1; clnt->cl_intr = 1;
clnt->cl_softrtry = 1; clnt->cl_softrtry = 1;
clnt->cl_chatty = 1; clnt->cl_chatty = 1;
cb->cb_client = clnt;
/* Kick rpciod, put the call on the wire. */ /* Kick rpciod, put the call on the wire. */
...@@ -444,6 +443,7 @@ nfsd4_probe_callback(struct nfs4_client *clp) ...@@ -444,6 +443,7 @@ nfsd4_probe_callback(struct nfs4_client *clp)
} }
/* the task holds a reference to the nfs4_client struct */ /* the task holds a reference to the nfs4_client struct */
cb->cb_client = clnt;
atomic_inc(&clp->cl_count); atomic_inc(&clp->cl_count);
msg.rpc_cred = nfsd4_lookupcred(clp,0); msg.rpc_cred = nfsd4_lookupcred(clp,0);
...@@ -456,6 +456,7 @@ nfsd4_probe_callback(struct nfs4_client *clp) ...@@ -456,6 +456,7 @@ nfsd4_probe_callback(struct nfs4_client *clp)
return; return;
out_rpciod: out_rpciod:
atomic_dec(&clp->cl_count);
rpciod_down(); rpciod_down();
out_clnt: out_clnt:
rpc_shutdown_client(clnt); rpc_shutdown_client(clnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment