aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index b9c3c43cea1d..98e8e35c4408 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -24,8 +24,6 @@
24 24
25static void nfs_do_free_delegation(struct nfs_delegation *delegation) 25static void nfs_do_free_delegation(struct nfs_delegation *delegation)
26{ 26{
27 if (delegation->cred)
28 put_rpccred(delegation->cred);
29 kfree(delegation); 27 kfree(delegation);
30} 28}
31 29
@@ -38,6 +36,10 @@ static void nfs_free_delegation_callback(struct rcu_head *head)
38 36
39static void nfs_free_delegation(struct nfs_delegation *delegation) 37static void nfs_free_delegation(struct nfs_delegation *delegation)
40{ 38{
39 if (delegation->cred) {
40 put_rpccred(delegation->cred);
41 delegation->cred = NULL;
42 }
41 call_rcu(&delegation->rcu, nfs_free_delegation_callback); 43 call_rcu(&delegation->rcu, nfs_free_delegation_callback);
42} 44}
43 45