summaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2018-03-07 13:49:12 -0800
committerDavid S. Miller <davem@davemloft.net>2018-03-08 12:48:57 -0500
commitb0dee7910317f41f398838992516af6a3b981d86 (patch)
treed8bb32f9c86acf62b0970d6ab20354562993714c /drivers/net/hyperv
parent35a57b7fef136fa3d5b735ba773f191b95110fa0 (diff)
downloadlinux-b0dee7910317f41f398838992516af6a3b981d86.tar.bz2
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>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c4
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);