diff options
author | Divy Le Ray <divy@chelsio.com> | 2009-04-17 14:21:22 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-20 11:07:25 +0200 |
commit | 2c2f409f32d55d901b28b4e9a06c40e9d899ad25 (patch) | |
tree | 69422cc7979abbfc15b9b4534446c3379202e7d4 /drivers/net/cxgb3/cxgb3_main.c | |
parent | cxgb3: fix workqueue flush issues (diff) | |
download | linux-2c2f409f32d55d901b28b4e9a06c40e9d899ad25.tar.xz linux-2c2f409f32d55d901b28b4e9a06c40e9d899ad25.zip |
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>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 7 |
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) while ((err = pci_enable_msix(adap->pdev, entries, vectors)) > 0) vectors = err; - if (!err && vectors < (adap->params.nports + 1)) + if (err < 0) + pci_disable_msix(adap->pdev); + + if (!err && vectors < (adap->params.nports + 1)) { + pci_disable_msix(adap->pdev); err = -1; + } if (!err) { for (i = 0; i < vectors; ++i) |