Skip to content

Commit

Permalink
hv_netvsc: fix locking during VF setup
Browse files Browse the repository at this point in the history
The dev_uc/mc_sync calls need to have the device address list
locked. This was spotted by running with lockdep enabled.

Fixes: bee9d41 ("hv_netvsc: propagate rx filters to VF")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
shemminger authored and davem330 committed Mar 8, 2018
1 parent 35a57b7 commit b0dee79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b0dee79

Please sign in to comment.