From: Ying Xue Date: Mon, 21 Apr 2014 02:55:44 +0000 (+0800) Subject: tipc: use RTNL lock to protect tipc_net_stop routine X-Git-Tag: v3.16-rc1~27^2~348^2~8 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=f97e455abf0d83b7d69da295163db18e3ebb4d8b;p=linux.git 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 Reviewed-by: Jon Maloy Reviewed-by: Erik Hugne Tested-by: Erik Hugne Signed-off-by: David S. Miller --- 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) 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"); }