diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-04-20 22:55:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-22 21:17:52 -0400 |
commit | f97e455abf0d83b7d69da295163db18e3ebb4d8b (patch) | |
tree | 2c3acf06e30c71220b54e873b14c6a5e497dd210 /net/tipc/net.c | |
parent | ca07fb07c9a362149ea72f0de8f7eefd00489ecc (diff) |
tipc: use RTNL lock to protect tipc_net_stop routine
As the tipc network initialization(ie, tipc_net_start routine) is
under RTNL protection, its corresponding deinitialization part(ie,
tipc_net_stop routine) should be protected by RTNL too.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Tested-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r-- | net/tipc/net.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c index 4c564eb69e1a..24d2d21266a4 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -195,11 +195,13 @@ void tipc_net_stop(void) | |||
195 | return; | 195 | return; |
196 | 196 | ||
197 | tipc_nametbl_withdraw(TIPC_CFG_SRV, tipc_own_addr, 0, tipc_own_addr); | 197 | tipc_nametbl_withdraw(TIPC_CFG_SRV, tipc_own_addr, 0, tipc_own_addr); |
198 | rtnl_lock(); | ||
198 | write_lock_bh(&tipc_net_lock); | 199 | write_lock_bh(&tipc_net_lock); |
199 | tipc_bearer_stop(); | 200 | tipc_bearer_stop(); |
200 | tipc_bclink_stop(); | 201 | tipc_bclink_stop(); |
201 | tipc_node_stop(); | 202 | tipc_node_stop(); |
202 | write_unlock_bh(&tipc_net_lock); | 203 | write_unlock_bh(&tipc_net_lock); |
204 | rtnl_unlock(); | ||
203 | 205 | ||
204 | pr_info("Left network mode\n"); | 206 | pr_info("Left network mode\n"); |
205 | } | 207 | } |