]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbevf: Handle previously-freed msix_entries
authorMark Rustad <mark.d.rustad@intel.com>
Fri, 28 Oct 2016 17:46:39 +0000 (10:46 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 25 Feb 2017 05:48:15 +0000 (21:48 -0800)
Orabug: 24568240

The msix_entries memory can be freed by a previous suspend or
remove, so don't crash on close when it isn't there. Also only
clear the interrupts when the interface is up, because there
aren't any when it is not up.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit eeffceee421b17a1d484679d738f278fbaa01384)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

index 70955cce22cc55a8c6caf54f2e53f25ed0e2c075..2e830ccecd06c1c90f05432f267b22ef433dd131 100644 (file)
@@ -1494,6 +1494,9 @@ static void ixgbevf_free_irq(struct ixgbevf_adapter *adapter)
 {
        int i, q_vectors;
 
+       if (!adapter->msix_entries)
+               return;
+
        q_vectors = adapter->num_msix_vectors;
        i = q_vectors - 1;
 
@@ -2551,6 +2554,9 @@ static void ixgbevf_free_q_vectors(struct ixgbevf_adapter *adapter)
  **/
 static void ixgbevf_reset_interrupt_capability(struct ixgbevf_adapter *adapter)
 {
+       if (!adapter->msix_entries)
+               return;
+
        pci_disable_msix(adapter->pdev);
        kfree(adapter->msix_entries);
        adapter->msix_entries = NULL;
@@ -3817,11 +3823,10 @@ static int ixgbevf_suspend(struct pci_dev *pdev, pm_message_t state)
                ixgbevf_free_irq(adapter);
                ixgbevf_free_all_tx_resources(adapter);
                ixgbevf_free_all_rx_resources(adapter);
+               ixgbevf_clear_interrupt_scheme(adapter);
                rtnl_unlock();
        }
 
-       ixgbevf_clear_interrupt_scheme(adapter);
-
 #ifdef CONFIG_PM
        retval = pci_save_state(pdev);
        if (retval)