File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 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,
167167 struct index_hashtable_entry * old ,
168168 struct index_hashtable_entry * new )
169169{
170- if ( unlikely ( hlist_unhashed ( & old -> index_hash )))
171- return false;
170+ bool ret ;
171+
172172 spin_lock_bh (& table -> lock );
173+ ret = !hlist_unhashed (& old -> index_hash );
174+ if (unlikely (!ret ))
175+ goto out ;
176+
173177 new -> index = old -> index ;
174178 hlist_replace_rcu (& old -> index_hash , & new -> index_hash );
175179
@@ -180,8 +184,9 @@ bool wg_index_hashtable_replace(struct index_hashtable *table,
180184 * simply gets dropped, which isn't terrible.
181185 */
182186 INIT_HLIST_NODE (& old -> index_hash );
187+ out :
183188 spin_unlock_bh (& table -> lock );
184- return true ;
189+ return ret ;
185190}
186191
187192void wg_index_hashtable_remove (struct index_hashtable * table ,
You can’t perform that action at this time.
0 commit comments