@@ -285,22 +285,14 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic,
285
285
return 0 ;
286
286
}
287
287
288
- static inline void __nr_remove_node (struct nr_node * nr_node )
288
+ static void nr_remove_node_locked (struct nr_node * nr_node )
289
289
{
290
+ lockdep_assert_held (& nr_node_list_lock );
291
+
290
292
hlist_del_init (& nr_node -> node_node );
291
293
nr_node_put (nr_node );
292
294
}
293
295
294
- #define nr_remove_node_locked (__node ) \
295
- __nr_remove_node(__node)
296
-
297
- static void nr_remove_node (struct nr_node * nr_node )
298
- {
299
- spin_lock_bh (& nr_node_list_lock );
300
- __nr_remove_node (nr_node );
301
- spin_unlock_bh (& nr_node_list_lock );
302
- }
303
-
304
296
static inline void __nr_remove_neigh (struct nr_neigh * nr_neigh )
305
297
{
306
298
hlist_del_init (& nr_neigh -> neigh_node );
@@ -339,6 +331,7 @@ static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n
339
331
return - EINVAL ;
340
332
}
341
333
334
+ spin_lock_bh (& nr_node_list_lock );
342
335
nr_node_lock (nr_node );
343
336
for (i = 0 ; i < nr_node -> count ; i ++ ) {
344
337
if (nr_node -> routes [i ].neighbour == nr_neigh ) {
@@ -352,7 +345,7 @@ static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n
352
345
nr_node -> count -- ;
353
346
354
347
if (nr_node -> count == 0 ) {
355
- nr_remove_node (nr_node );
348
+ nr_remove_node_locked (nr_node );
356
349
} else {
357
350
switch (i ) {
358
351
case 0 :
@@ -367,12 +360,14 @@ static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n
367
360
nr_node_put (nr_node );
368
361
}
369
362
nr_node_unlock (nr_node );
363
+ spin_unlock_bh (& nr_node_list_lock );
370
364
371
365
return 0 ;
372
366
}
373
367
}
374
368
nr_neigh_put (nr_neigh );
375
369
nr_node_unlock (nr_node );
370
+ spin_unlock_bh (& nr_node_list_lock );
376
371
nr_node_put (nr_node );
377
372
378
373
return - EINVAL ;
0 commit comments