Skip to content

Commit

Permalink
SUNRPC: Defer deleting the security context until gss_do_free_ctx()
Browse files Browse the repository at this point in the history
There is no need to delete the gss context separately from the rest
of the security context information, and doing so gives rise to a
an rcu_dereference_check() warning.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 4, 2010
1 parent c3ae62a commit 0d8a374
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions net/sunrpc/auth_gss/auth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@ gss_do_free_ctx(struct gss_cl_ctx *ctx)
{
dprintk("RPC: gss_free_ctx\n");

gss_delete_sec_context(&ctx->gc_gss_ctx);
kfree(ctx->gc_wire_ctx.data);
kfree(ctx);
}
Expand All @@ -942,13 +943,7 @@ gss_free_ctx_callback(struct rcu_head *head)
static void
gss_free_ctx(struct gss_cl_ctx *ctx)
{
struct gss_ctx *gc_gss_ctx;

gc_gss_ctx = rcu_dereference(ctx->gc_gss_ctx);
rcu_assign_pointer(ctx->gc_gss_ctx, NULL);
call_rcu(&ctx->gc_rcu, gss_free_ctx_callback);
if (gc_gss_ctx)
gss_delete_sec_context(&gc_gss_ctx);
}

static void
Expand Down

0 comments on commit 0d8a374

Please sign in to comment.