diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 6a44eb812baf..8972ca1c654c 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -551,21 +551,23 @@ static void tipc_node_timeout(struct timer_list *t) | |||
551 | struct tipc_node *n = from_timer(n, t, timer); | 551 | struct tipc_node *n = from_timer(n, t, timer); |
552 | struct tipc_link_entry *le; | 552 | struct tipc_link_entry *le; |
553 | struct sk_buff_head xmitq; | 553 | struct sk_buff_head xmitq; |
554 | int remains = n->link_cnt; | ||
554 | int bearer_id; | 555 | int bearer_id; |
555 | int rc = 0; | 556 | int rc = 0; |
556 | 557 | ||
557 | __skb_queue_head_init(&xmitq); | 558 | __skb_queue_head_init(&xmitq); |
558 | 559 | ||
559 | for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) { | 560 | for (bearer_id = 0; remains && (bearer_id < MAX_BEARERS); bearer_id++) { |
560 | tipc_node_read_lock(n); | 561 | tipc_node_read_lock(n); |
561 | le = &n->links[bearer_id]; | 562 | le = &n->links[bearer_id]; |
562 | spin_lock_bh(&le->lock); | ||
563 | if (le->link) { | 563 | if (le->link) { |
564 | spin_lock_bh(&le->lock); | ||
564 | /* Link tolerance may change asynchronously: */ | 565 | /* Link tolerance may change asynchronously: */ |
565 | tipc_node_calculate_timer(n, le->link); | 566 | tipc_node_calculate_timer(n, le->link); |
566 | rc = tipc_link_timeout(le->link, &xmitq); | 567 | rc = tipc_link_timeout(le->link, &xmitq); |
568 | spin_unlock_bh(&le->lock); | ||
569 | remains--; | ||
567 | } | 570 | } |
568 | spin_unlock_bh(&le->lock); | ||
569 | tipc_node_read_unlock(n); | 571 | tipc_node_read_unlock(n); |
570 | tipc_bearer_xmit(n->net, bearer_id, &xmitq, &le->maddr); | 572 | tipc_bearer_xmit(n->net, bearer_id, &xmitq, &le->maddr); |
571 | if (rc & TIPC_LINK_DOWN_EVT) | 573 | if (rc & TIPC_LINK_DOWN_EVT) |