Skip to content

Commit

Permalink
tipc: use RTNL lock to protect tipc_net_stop routine
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ying Xue authored and David S. Miller committed Apr 23, 2014
1 parent ca07fb0 commit f97e455
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tipc/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,13 @@ void tipc_net_stop(void)
return;

tipc_nametbl_withdraw(TIPC_CFG_SRV, tipc_own_addr, 0, tipc_own_addr);
rtnl_lock();
write_lock_bh(&tipc_net_lock);
tipc_bearer_stop();
tipc_bclink_stop();
tipc_node_stop();
write_unlock_bh(&tipc_net_lock);
rtnl_unlock();

pr_info("Left network mode\n");
}

0 comments on commit f97e455

Please sign in to comment.