aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2009-04-17 08:21:22 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-20 05:07:25 -0400
commit2c2f409f32d55d901b28b4e9a06c40e9d899ad25 (patch)
tree69422cc7979abbfc15b9b4534446c3379202e7d4
parentc80b0c28caed5cd9165caab6295ed86b4e9fc327 (diff)
cxgb3: Fix potential msi-x vector leak
Release vectors when a MSI-X allocation fails. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 99b5032afda6..cbd59fe618a9 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2917,8 +2917,13 @@ static int __devinit cxgb_enable_msix(struct adapter *adap)
2917 while ((err = pci_enable_msix(adap->pdev, entries, vectors)) > 0) 2917 while ((err = pci_enable_msix(adap->pdev, entries, vectors)) > 0)
2918 vectors = err; 2918 vectors = err;
2919 2919
2920 if (!err && vectors < (adap->params.nports + 1)) 2920 if (err < 0)
2921 pci_disable_msix(adap->pdev);
2922
2923 if (!err && vectors < (adap->params.nports + 1)) {
2924 pci_disable_msix(adap->pdev);
2921 err = -1; 2925 err = -1;
2926 }
2922 2927
2923 if (!err) { 2928 if (!err) {
2924 for (i = 0; i < vectors; ++i) 2929 for (i = 0; i < vectors; ++i)