Skip to content

Commit

Permalink
SUNRPC: Remove extra xprt_put()
Browse files Browse the repository at this point in the history
While testing error cases where rpc_new_client() fails, I saw
some oopses.

If rpc_new_client() fails, it already invokes xprt_put().  Thus
__rpc_clone_client() does not need to invoke it again.

Introduced by commit 1b63a75 "SUNRPC: Refactor rpc_clone_client()"
Fri Sep 14, 2012.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org [>=3.7]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Apr 5, 2013
1 parent 1166fde commit a58e0be
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
new = rpc_new_client(args, xprt);
if (IS_ERR(new)) {
err = PTR_ERR(new);
goto out_put;
goto out_err;
}

atomic_inc(&clnt->cl_count);
Expand All @@ -525,8 +525,6 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
new->cl_chatty = clnt->cl_chatty;
return new;

out_put:
xprt_put(xprt);
out_err:
dprintk("RPC: %s: returned error %d\n", __func__, err);
return ERR_PTR(err);
Expand Down

0 comments on commit a58e0be

Please sign in to comment.