aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/auth_gss.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_gss/auth_gss.c')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 55c47ae0a258..068fa6dfb64e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -694,15 +694,25 @@ gss_destroy_ctx(struct gss_cl_ctx *ctx)
694} 694}
695 695
696static void 696static void
697gss_destroy_cred(struct rpc_cred *rc) 697gss_free_cred(struct gss_cred *gss_cred)
698{ 698{
699 struct gss_cred *cred = container_of(rc, struct gss_cred, gc_base); 699 dprintk("RPC: gss_free_cred %p\n", gss_cred);
700 if (gss_cred->gc_ctx)
701 gss_put_ctx(gss_cred->gc_ctx);
702 kfree(gss_cred);
703}
700 704
701 dprintk("RPC: gss_destroy_cred \n"); 705static void
706gss_free_cred_callback(struct rcu_head *head)
707{
708 struct gss_cred *gss_cred = container_of(head, struct gss_cred, gc_base.cr_rcu);
709 gss_free_cred(gss_cred);
710}
702 711
703 if (cred->gc_ctx) 712static void
704 gss_put_ctx(cred->gc_ctx); 713gss_destroy_cred(struct rpc_cred *cred)
705 kfree(cred); 714{
715 call_rcu(&cred->cr_rcu, gss_free_cred_callback);
706} 716}
707 717
708/* 718/*