Commit 8d56ff11 authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: Fix cleanup path in be_probe()

Disabling msix was missing when probe fails after enabling msix.
Signed-off-by: default avatarSathya Perla <sathyap@serverengines.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2243e2e9
......@@ -1476,6 +1476,14 @@ static void be_worker(struct work_struct *work)
schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}
static void be_msix_disable(struct be_adapter *adapter)
{
if (adapter->msix_enabled) {
pci_disable_msix(adapter->pdev);
adapter->msix_enabled = false;
}
}
static void be_msix_enable(struct be_adapter *adapter)
{
int i, status;
......@@ -2096,6 +2104,7 @@ static int be_stats_init(struct be_adapter *adapter)
static void __devexit be_remove(struct pci_dev *pdev)
{
struct be_adapter *adapter = pci_get_drvdata(pdev);
if (!adapter)
return;
......@@ -2107,10 +2116,7 @@ static void __devexit be_remove(struct pci_dev *pdev)
be_ctrl_cleanup(adapter);
if (adapter->msix_enabled) {
pci_disable_msix(adapter->pdev);
adapter->msix_enabled = false;
}
be_msix_disable(adapter);
pci_set_drvdata(pdev, NULL);
pci_release_regions(pdev);
......@@ -2230,7 +2236,9 @@ static int __devinit be_probe(struct pci_dev *pdev,
ctrl_clean:
be_ctrl_cleanup(adapter);
free_netdev:
be_msix_disable(adapter);
free_netdev(adapter->netdev);
pci_set_drvdata(pdev, NULL);
rel_reg:
pci_release_regions(pdev);
disable_dev:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment