File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,13 @@ bool wg_index_hashtable_replace(struct index_hashtable *table,
167
167
struct index_hashtable_entry * old ,
168
168
struct index_hashtable_entry * new )
169
169
{
170
- if ( unlikely ( hlist_unhashed ( & old -> index_hash )))
171
- return false;
170
+ bool ret ;
171
+
172
172
spin_lock_bh (& table -> lock );
173
+ ret = !hlist_unhashed (& old -> index_hash );
174
+ if (unlikely (!ret ))
175
+ goto out ;
176
+
173
177
new -> index = old -> index ;
174
178
hlist_replace_rcu (& old -> index_hash , & new -> index_hash );
175
179
@@ -180,8 +184,9 @@ bool wg_index_hashtable_replace(struct index_hashtable *table,
180
184
* simply gets dropped, which isn't terrible.
181
185
*/
182
186
INIT_HLIST_NODE (& old -> index_hash );
187
+ out :
183
188
spin_unlock_bh (& table -> lock );
184
- return true ;
189
+ return ret ;
185
190
}
186
191
187
192
void wg_index_hashtable_remove (struct index_hashtable * table ,
You can’t perform that action at this time.
0 commit comments