diff options
Diffstat (limited to 'net/tipc/node.c')
| -rw-r--r-- | net/tipc/node.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 713ab5d7c54f..a24fad32345e 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
| @@ -233,7 +233,7 @@ struct tipc_node *tipc_node_attach_link(struct link *l_ptr) | |||
| 233 | 233 | ||
| 234 | if (!n_ptr->links[bearer_id]) { | 234 | if (!n_ptr->links[bearer_id]) { |
| 235 | n_ptr->links[bearer_id] = l_ptr; | 235 | n_ptr->links[bearer_id] = l_ptr; |
| 236 | tipc_net.links++; | 236 | atomic_inc(&tipc_net.links); |
| 237 | n_ptr->link_cnt++; | 237 | n_ptr->link_cnt++; |
| 238 | return n_ptr; | 238 | return n_ptr; |
| 239 | } | 239 | } |
| @@ -247,7 +247,7 @@ struct tipc_node *tipc_node_attach_link(struct link *l_ptr) | |||
| 247 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) | 247 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) |
| 248 | { | 248 | { |
| 249 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; | 249 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; |
| 250 | tipc_net.links--; | 250 | atomic_dec(&tipc_net.links); |
| 251 | n_ptr->link_cnt--; | 251 | n_ptr->link_cnt--; |
| 252 | } | 252 | } |
| 253 | 253 | ||
| @@ -450,7 +450,8 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) | |||
| 450 | 450 | ||
| 451 | /* Get space for all unicast links + multicast link */ | 451 | /* Get space for all unicast links + multicast link */ |
| 452 | 452 | ||
| 453 | payload_size = TLV_SPACE(sizeof(link_info)) * (tipc_net.links + 1); | 453 | payload_size = TLV_SPACE(sizeof(link_info)) * |
| 454 | (atomic_read(&tipc_net.links) + 1); | ||
| 454 | if (payload_size > 32768u) { | 455 | if (payload_size > 32768u) { |
| 455 | read_unlock_bh(&tipc_net_lock); | 456 | read_unlock_bh(&tipc_net_lock); |
| 456 | return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED | 457 | return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED |
