]> Git Repo - linux.git/commitdiff
tipc: use RTNL lock to protect tipc_net_stop routine
authorYing Xue <[email protected]>
Mon, 21 Apr 2014 02:55:44 +0000 (10:55 +0800)
committerDavid S. Miller <[email protected]>
Wed, 23 Apr 2014 01:17:52 +0000 (21:17 -0400)
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 <[email protected]>
Reviewed-by: Jon Maloy <[email protected]>
Reviewed-by: Erik Hugne <[email protected]>
Tested-by: Erik Hugne <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/tipc/net.c

index 4c564eb69e1ad9bd2695e78eb91464a0112e663c..24d2d21266a4140860f75b979878776bc5f6a665 100644 (file)
@@ -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");
 }
This page took 0.045813 seconds and 4 git commands to generate.