aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 93dfd75aba7c..f2f3b284e6dd 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -112,6 +112,7 @@ struct nfs_client_initdata {
112static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init) 112static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
113{ 113{
114 struct nfs_client *clp; 114 struct nfs_client *clp;
115 struct rpc_cred *cred;
115 116
116 if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL) 117 if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL)
117 goto error_0; 118 goto error_0;
@@ -150,6 +151,9 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
150 clp->cl_boot_time = CURRENT_TIME; 151 clp->cl_boot_time = CURRENT_TIME;
151 clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED; 152 clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED;
152#endif 153#endif
154 cred = rpc_lookup_machine_cred();
155 if (!IS_ERR(cred))
156 clp->cl_machine_cred = cred;
153 157
154 return clp; 158 return clp;
155 159
@@ -191,6 +195,9 @@ static void nfs_free_client(struct nfs_client *clp)
191 if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state)) 195 if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state))
192 nfs_callback_down(); 196 nfs_callback_down();
193 197
198 if (clp->cl_machine_cred != NULL)
199 put_rpccred(clp->cl_machine_cred);
200
194 kfree(clp->cl_hostname); 201 kfree(clp->cl_hostname);
195 kfree(clp); 202 kfree(clp);
196 203