Commit 3acb458c32293405cf68985b7b3ac5dc0a5e7929
Committed by
Paul E. McKenney
1 parent
75ef0368d1
Exists in
master
and in
20 other branches
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: 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>
Showing 1 changed file with 2 additions and 14 deletions Side-by-side Diff
security/keys/user_defined.c
... | ... | @@ -69,18 +69,6 @@ |
69 | 69 | EXPORT_SYMBOL_GPL(user_instantiate); |
70 | 70 | |
71 | 71 | /* |
72 | - * dispose of the old data from an updated user defined key | |
73 | - */ | |
74 | -static void user_update_rcu_disposal(struct rcu_head *rcu) | |
75 | -{ | |
76 | - struct user_key_payload *upayload; | |
77 | - | |
78 | - upayload = container_of(rcu, struct user_key_payload, rcu); | |
79 | - | |
80 | - kfree(upayload); | |
81 | -} | |
82 | - | |
83 | -/* | |
84 | 72 | * update a user defined key |
85 | 73 | * - the key's semaphore is write-locked |
86 | 74 | */ |
... | ... | @@ -114,7 +102,7 @@ |
114 | 102 | key->expiry = 0; |
115 | 103 | } |
116 | 104 | |
117 | - call_rcu(&zap->rcu, user_update_rcu_disposal); | |
105 | + kfree_rcu(zap, rcu); | |
118 | 106 | |
119 | 107 | error: |
120 | 108 | return ret; |
... | ... | @@ -145,7 +133,7 @@ |
145 | 133 | |
146 | 134 | if (upayload) { |
147 | 135 | rcu_assign_pointer(key->payload.data, NULL); |
148 | - call_rcu(&upayload->rcu, user_update_rcu_disposal); | |
136 | + kfree_rcu(upayload, rcu); | |
149 | 137 | } |
150 | 138 | } |
151 | 139 |