@@ -395,21 +396,19 @@ static void tipc_node_delete(struct tipc_node *node)  {
        list_del_rcu(&node->list);
        hlist_del_rcu(&node->hash);

It's better to move two lines of code above to tipc_node_kref_release(), 
ensuring we remove the node from the two lists only when node is released.

Regards,
Ying

-       kfree(node->bc_entry.link);
-       kfree_rcu(node, rcu);
+       tipc_node_put(node);
+       if (del_timer(&node->timer))
+               tipc_node_put(node);
 }
 
 void tipc_node_stop(struct net *net)
 {
-       struct tipc_net *tn = net_generic(net, tipc_net_id);
+       struct tipc_net *tn = tipc_net(net);
        struct tipc_node *node, *t_node;
 
        spin_lock_bh(&tn->node_list_lock);
-       list_for_each_entry_safe(node, t_node, &tn->node_list, list) {
-               if (del_timer(&node->timer))
-                       tipc_node_put(node);
-               tipc_node_put(node);
-       }
+       list_for_each_entry_safe(node, t_node, &tn->node_list, list)
+               tipc_node_delete(node);
        spin_unlock_bh(&tn->node_list_lock);
 }
 
--
1.9.1


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to