@@ -287,7 +287,7 @@ static int rpc_client_register(const struct rpc_create_args *args,
struct rpc_auth *auth;
struct net *net = rpc_net_ns(clnt);
struct super_block *pipefs_sb;
- int err = 0;
+ int err;
pipefs_sb = rpc_get_sb_net(net);
if (pipefs_sb) {
@@ -296,6 +296,10 @@ static int rpc_client_register(const struct rpc_create_args *args,
goto out;
}
+ rpc_register_client(clnt);
+ if (pipefs_sb)
+ rpc_put_sb_net(net);
+
auth = rpcauth_create(args->authflavor, clnt);
if (IS_ERR(auth)) {
dprintk("RPC: Couldn't create auth handle (flavor %u)\n",
@@ -303,16 +307,14 @@ static int rpc_client_register(const struct rpc_create_args *args,
err = PTR_ERR(auth);
goto err_auth;
}
-
- rpc_register_client(clnt);
+ return 0;
+err_auth:
+ pipefs_sb = rpc_get_sb_net(net);
+ __rpc_clnt_remove_pipedir(clnt);
out:
if (pipefs_sb)
rpc_put_sb_net(net);
return err;
-
-err_auth:
- __rpc_clnt_remove_pipedir(clnt);
- goto out;
}
static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt)