iwlwifi: pcie: Fix index iteration on free_irq in MSIX mode
authorHaim Dreyfuss <haim.dreyfuss@intel.com>
Sun, 27 Mar 2016 09:56:13 +0000 (12:56 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 30 Mar 2016 13:24:50 +0000 (16:24 +0300)
In MSIX mode we iterate over the allocated interrupt vectors and
register them to an handler. In case of registration failure,
we free all the allocated irq.
we use the outer index mistakenly instead of the inner one.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

index f1a506b609d7e2345a9c06920cca006111bbbae4..5e1a13e82d6006726a9e9c36fd7a91e6324f65fa 100644 (file)
@@ -1500,8 +1500,8 @@ static int iwl_pcie_init_msix_handler(struct pci_dev *pdev,
                        IWL_ERR(trans_pcie->trans,
                                "Error allocating IRQ %d\n", i);
                        for (j = 0; j < i; j++)
-                               free_irq(trans_pcie->msix_entries[i].vector,
-                                        &trans_pcie->msix_entries[i]);
+                               free_irq(trans_pcie->msix_entries[j].vector,
+                                        &trans_pcie->msix_entries[j]);
                        pci_disable_msix(pdev);
                        return ret;
                }