diff options
author | Sathya Perla <sathyap@serverengines.com> | 2009-11-22 17:02:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-23 13:44:27 -0500 |
commit | 8d56ff11708e5809c644a6d687a5dff4551043b4 (patch) | |
tree | 77a3f9840794e2f36faf95bc7b6be6233bec582a /drivers/net/benet | |
parent | 2243e2e95e24f4c4b1c6575b874ebe0b837d2208 (diff) |
be2net: Fix cleanup path in be_probe()
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>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r-- | drivers/net/benet/be_main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 4635b3fdcc3b..795936439498 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1476,6 +1476,14 @@ static void be_worker(struct work_struct *work) | |||
1476 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); | 1476 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); |
1477 | } | 1477 | } |
1478 | 1478 | ||
1479 | static void be_msix_disable(struct be_adapter *adapter) | ||
1480 | { | ||
1481 | if (adapter->msix_enabled) { | ||
1482 | pci_disable_msix(adapter->pdev); | ||
1483 | adapter->msix_enabled = false; | ||
1484 | } | ||
1485 | } | ||
1486 | |||
1479 | static void be_msix_enable(struct be_adapter *adapter) | 1487 | static void be_msix_enable(struct be_adapter *adapter) |
1480 | { | 1488 | { |
1481 | int i, status; | 1489 | int i, status; |
@@ -2096,6 +2104,7 @@ static int be_stats_init(struct be_adapter *adapter) | |||
2096 | static void __devexit be_remove(struct pci_dev *pdev) | 2104 | static void __devexit be_remove(struct pci_dev *pdev) |
2097 | { | 2105 | { |
2098 | struct be_adapter *adapter = pci_get_drvdata(pdev); | 2106 | struct be_adapter *adapter = pci_get_drvdata(pdev); |
2107 | |||
2099 | if (!adapter) | 2108 | if (!adapter) |
2100 | return; | 2109 | return; |
2101 | 2110 | ||
@@ -2107,10 +2116,7 @@ static void __devexit be_remove(struct pci_dev *pdev) | |||
2107 | 2116 | ||
2108 | be_ctrl_cleanup(adapter); | 2117 | be_ctrl_cleanup(adapter); |
2109 | 2118 | ||
2110 | if (adapter->msix_enabled) { | 2119 | be_msix_disable(adapter); |
2111 | pci_disable_msix(adapter->pdev); | ||
2112 | adapter->msix_enabled = false; | ||
2113 | } | ||
2114 | 2120 | ||
2115 | pci_set_drvdata(pdev, NULL); | 2121 | pci_set_drvdata(pdev, NULL); |
2116 | pci_release_regions(pdev); | 2122 | pci_release_regions(pdev); |
@@ -2230,7 +2236,9 @@ stats_clean: | |||
2230 | ctrl_clean: | 2236 | ctrl_clean: |
2231 | be_ctrl_cleanup(adapter); | 2237 | be_ctrl_cleanup(adapter); |
2232 | free_netdev: | 2238 | free_netdev: |
2239 | be_msix_disable(adapter); | ||
2233 | free_netdev(adapter->netdev); | 2240 | free_netdev(adapter->netdev); |
2241 | pci_set_drvdata(pdev, NULL); | ||
2234 | rel_reg: | 2242 | rel_reg: |
2235 | pci_release_regions(pdev); | 2243 | pci_release_regions(pdev); |
2236 | disable_dev: | 2244 | disable_dev: |