aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs4proc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4aeb14e902d9..4b6a2f05b335 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6003,10 +6003,12 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct
6003 .rpc_resp = &res, 6003 .rpc_resp = &res,
6004 }; 6004 };
6005 struct rpc_clnt *clnt = NFS_SERVER(dir)->client; 6005 struct rpc_clnt *clnt = NFS_SERVER(dir)->client;
6006 struct rpc_cred *cred = NULL;
6006 6007
6007 if (use_integrity) { 6008 if (use_integrity) {
6008 clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient; 6009 clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient;
6009 msg.rpc_cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client); 6010 cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client);
6011 msg.rpc_cred = cred;
6010 } 6012 }
6011 6013
6012 dprintk("NFS call secinfo %s\n", name->name); 6014 dprintk("NFS call secinfo %s\n", name->name);
@@ -6018,8 +6020,8 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct
6018 &res.seq_res, 0); 6020 &res.seq_res, 0);
6019 dprintk("NFS reply secinfo: %d\n", status); 6021 dprintk("NFS reply secinfo: %d\n", status);
6020 6022
6021 if (msg.rpc_cred) 6023 if (cred)
6022 put_rpccred(msg.rpc_cred); 6024 put_rpccred(cred);
6023 6025
6024 return status; 6026 return status;
6025} 6027}
@@ -7500,11 +7502,13 @@ _nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
7500 .rpc_resp = &res, 7502 .rpc_resp = &res,
7501 }; 7503 };
7502 struct rpc_clnt *clnt = server->client; 7504 struct rpc_clnt *clnt = server->client;
7505 struct rpc_cred *cred = NULL;
7503 int status; 7506 int status;
7504 7507
7505 if (use_integrity) { 7508 if (use_integrity) {
7506 clnt = server->nfs_client->cl_rpcclient; 7509 clnt = server->nfs_client->cl_rpcclient;
7507 msg.rpc_cred = nfs4_get_clid_cred(server->nfs_client); 7510 cred = nfs4_get_clid_cred(server->nfs_client);
7511 msg.rpc_cred = cred;
7508 } 7512 }
7509 7513
7510 dprintk("--> %s\n", __func__); 7514 dprintk("--> %s\n", __func__);
@@ -7512,8 +7516,8 @@ _nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
7512 &res.seq_res, 0); 7516 &res.seq_res, 0);
7513 dprintk("<-- %s status=%d\n", __func__, status); 7517 dprintk("<-- %s status=%d\n", __func__, status);
7514 7518
7515 if (msg.rpc_cred) 7519 if (cred)
7516 put_rpccred(msg.rpc_cred); 7520 put_rpccred(cred);
7517 7521
7518 return status; 7522 return status;
7519} 7523}