Skip to content

Commit

Permalink
be2net: Fix cleanup path in be_probe()
Browse files Browse the repository at this point in the history
Disabling msix was missing when probe fails after enabling msix.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sathya Perla authored and David S. Miller committed Nov 23, 2009
1 parent 2243e2e commit 8d56ff1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8d56ff1

Please sign in to comment.