Skip to content

Commit

Permalink
security,rcu: convert call_rcu(user_update_rcu_disposal) to kfree_rcu()
Browse files Browse the repository at this point in the history
The rcu callback user_update_rcu_disposal() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(user_update_rcu_disposal).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
Lai Jiangshan authored and paulmck committed May 8, 2011
1 parent 75ef036 commit 3acb458
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions security/keys/user_defined.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)

EXPORT_SYMBOL_GPL(user_instantiate);

/*
* dispose of the old data from an updated user defined key
*/
static void user_update_rcu_disposal(struct rcu_head *rcu)
{
struct user_key_payload *upayload;

upayload = container_of(rcu, struct user_key_payload, rcu);

kfree(upayload);
}

/*
* update a user defined key
* - the key's semaphore is write-locked
Expand Down Expand Up @@ -114,7 +102,7 @@ int user_update(struct key *key, const void *data, size_t datalen)
key->expiry = 0;
}

call_rcu(&zap->rcu, user_update_rcu_disposal);
kfree_rcu(zap, rcu);

error:
return ret;
Expand Down Expand Up @@ -145,7 +133,7 @@ void user_revoke(struct key *key)

if (upayload) {
rcu_assign_pointer(key->payload.data, NULL);
call_rcu(&upayload->rcu, user_update_rcu_disposal);
kfree_rcu(upayload, rcu);
}
}

Expand Down

0 comments on commit 3acb458

Please sign in to comment.