diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2018-03-07 13:49:12 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-08 12:48:57 -0500 |
commit | b0dee7910317f41f398838992516af6a3b981d86 (patch) | |
tree | d8bb32f9c86acf62b0970d6ab20354562993714c | |
parent | 35a57b7fef136fa3d5b735ba773f191b95110fa0 (diff) | |
download | linux-b0dee7910317f41f398838992516af6a3b981d86.tar.gz linux-b0dee7910317f41f398838992516af6a3b981d86.tar.bz2 linux-b0dee7910317f41f398838992516af6a3b981d86.zip |
hv_netvsc: fix locking during VF setup
The dev_uc/mc_sync calls need to have the device address list
locked. This was spotted by running with lockdep enabled.
Fixes: bee9d41b37ea ("hv_netvsc: propagate rx filters to VF")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 48d9fa7a66c2..faea0be18924 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1851,8 +1851,12 @@ static void __netvsc_vf_setup(struct net_device *ndev, /* set multicast etc flags on VF */ dev_change_flags(vf_netdev, ndev->flags | IFF_SLAVE); + + /* sync address list from ndev to VF */ + netif_addr_lock_bh(ndev); dev_uc_sync(vf_netdev, ndev); dev_mc_sync(vf_netdev, ndev); + netif_addr_unlock_bh(ndev); if (netif_running(ndev)) { ret = dev_open(vf_netdev); |