Skip to content

Commit f97e455

Browse files
ying-xuedavem330
authored andcommitted
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>
1 parent ca07fb0 commit f97e455

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/tipc/net.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,13 @@ void tipc_net_stop(void)
195195
return;
196196

197197
tipc_nametbl_withdraw(TIPC_CFG_SRV, tipc_own_addr, 0, tipc_own_addr);
198+
rtnl_lock();
198199
write_lock_bh(&tipc_net_lock);
199200
tipc_bearer_stop();
200201
tipc_bclink_stop();
201202
tipc_node_stop();
202203
write_unlock_bh(&tipc_net_lock);
204+
rtnl_unlock();
203205

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

0 commit comments

Comments
 (0)