]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/ethernet/intel/igbvf/ethtool.c
igbvf: add lock around mailbox ops
[mirror_ubuntu-bionic-kernel.git] / drivers / net / ethernet / intel / igbvf / ethtool.c
index 34faa113a8a018e1e42a5ff1eebc867be65ad10d..a127688e83e64c244e0c381e5e11f4748d2d4d42 100644 (file)
@@ -296,8 +296,12 @@ static int igbvf_link_test(struct igbvf_adapter *adapter, u64 *data)
        struct e1000_hw *hw = &adapter->hw;
        *data = 0;
 
+       spin_lock_bh(&hw->mbx_lock);
+
        hw->mac.ops.check_for_link(hw);
 
+       spin_unlock_bh(&hw->mbx_lock);
+
        if (!(er32(STATUS) & E1000_STATUS_LU))
                *data = 1;