aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 4bbc59cc237c..53995af9ca4b 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -736,9 +736,6 @@ gss_do_free_ctx(struct gss_cl_ctx *ctx)
736{ 736{
737 dprintk("RPC: gss_free_ctx\n"); 737 dprintk("RPC: gss_free_ctx\n");
738 738
739 if (ctx->gc_gss_ctx)
740 gss_delete_sec_context(&ctx->gc_gss_ctx);
741
742 kfree(ctx->gc_wire_ctx.data); 739 kfree(ctx->gc_wire_ctx.data);
743 kfree(ctx); 740 kfree(ctx);
744} 741}
@@ -753,7 +750,13 @@ gss_free_ctx_callback(struct rcu_head *head)
753static void 750static void
754gss_free_ctx(struct gss_cl_ctx *ctx) 751gss_free_ctx(struct gss_cl_ctx *ctx)
755{ 752{
753 struct gss_ctx *gc_gss_ctx;
754
755 gc_gss_ctx = rcu_dereference(ctx->gc_gss_ctx);
756 rcu_assign_pointer(ctx->gc_gss_ctx, NULL);
756 call_rcu(&ctx->gc_rcu, gss_free_ctx_callback); 757 call_rcu(&ctx->gc_rcu, gss_free_ctx_callback);
758 if (gc_gss_ctx)
759 gss_delete_sec_context(&gc_gss_ctx);
757} 760}
758 761
759static void 762static void