aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c
index b5b337f5516d..cce8d086f173 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -39,6 +39,7 @@
39#include "name_distr.h" 39#include "name_distr.h"
40#include "subscr.h" 40#include "subscr.h"
41#include "port.h" 41#include "port.h"
42#include "node.h"
42#include "config.h" 43#include "config.h"
43 44
44/* 45/*
@@ -108,27 +109,21 @@
108*/ 109*/
109 110
110DEFINE_RWLOCK(tipc_net_lock); 111DEFINE_RWLOCK(tipc_net_lock);
111struct tipc_node **tipc_nodes;
112u32 tipc_highest_node;
113atomic_t tipc_num_links; 112atomic_t tipc_num_links;
114 113
115static int net_start(void) 114static int net_start(void)
116{ 115{
117 tipc_nodes = kcalloc(4096, sizeof(*tipc_nodes), GFP_ATOMIC);
118 tipc_highest_node = 0;
119 atomic_set(&tipc_num_links, 0); 116 atomic_set(&tipc_num_links, 0);
120 117
121 return tipc_nodes ? 0 : -ENOMEM; 118 return 0;
122} 119}
123 120
124static void net_stop(void) 121static void net_stop(void)
125{ 122{
126 u32 n_num; 123 struct tipc_node *node, *t_node;
127 124
128 for (n_num = 1; n_num <= tipc_highest_node; n_num++) 125 list_for_each_entry_safe(node, t_node, &tipc_node_list, list)
129 tipc_node_delete(tipc_nodes[n_num]); 126 tipc_node_delete(node);
130 kfree(tipc_nodes);
131 tipc_nodes = NULL;
132} 127}
133 128
134static void net_route_named_msg(struct sk_buff *buf) 129static void net_route_named_msg(struct sk_buff *buf)