diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 2afc4f8c37a7..488019766433 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -584,12 +584,15 @@ static void tipc_node_clear_links(struct tipc_node *node) | |||
584 | /* tipc_node_cleanup - delete nodes that does not | 584 | /* tipc_node_cleanup - delete nodes that does not |
585 | * have active links for NODE_CLEANUP_AFTER time | 585 | * have active links for NODE_CLEANUP_AFTER time |
586 | */ | 586 | */ |
587 | static int tipc_node_cleanup(struct tipc_node *peer) | 587 | static bool tipc_node_cleanup(struct tipc_node *peer) |
588 | { | 588 | { |
589 | struct tipc_net *tn = tipc_net(peer->net); | 589 | struct tipc_net *tn = tipc_net(peer->net); |
590 | bool deleted = false; | 590 | bool deleted = false; |
591 | 591 | ||
592 | spin_lock_bh(&tn->node_list_lock); | 592 | /* If lock held by tipc_node_stop() the node will be deleted anyway */ |
593 | if (!spin_trylock_bh(&tn->node_list_lock)) | ||
594 | return false; | ||
595 | |||
593 | tipc_node_write_lock(peer); | 596 | tipc_node_write_lock(peer); |
594 | 597 | ||
595 | if (!node_is_up(peer) && time_after(jiffies, peer->delete_at)) { | 598 | if (!node_is_up(peer) && time_after(jiffies, peer->delete_at)) { |