提交 3acb458c 编写于 作者: L Lai Jiangshan 提交者: Paul E. McKenney

security,rcu: convert call_rcu(user_update_rcu_disposal) to kfree_rcu()

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: NLai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: NDavid Howells <dhowells@redhat.com>
Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
上级 75ef0368
...@@ -68,18 +68,6 @@ int user_instantiate(struct key *key, const void *data, size_t datalen) ...@@ -68,18 +68,6 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
EXPORT_SYMBOL_GPL(user_instantiate); 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 * update a user defined key
* - the key's semaphore is write-locked * - the key's semaphore is write-locked
...@@ -114,7 +102,7 @@ int user_update(struct key *key, const void *data, size_t datalen) ...@@ -114,7 +102,7 @@ int user_update(struct key *key, const void *data, size_t datalen)
key->expiry = 0; key->expiry = 0;
} }
call_rcu(&zap->rcu, user_update_rcu_disposal); kfree_rcu(zap, rcu);
error: error:
return ret; return ret;
...@@ -145,7 +133,7 @@ void user_revoke(struct key *key) ...@@ -145,7 +133,7 @@ void user_revoke(struct key *key)
if (upayload) { if (upayload) {
rcu_assign_pointer(key->payload.data, NULL); rcu_assign_pointer(key->payload.data, NULL);
call_rcu(&upayload->rcu, user_update_rcu_disposal); kfree_rcu(upayload, rcu);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册