mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-11 20:37:59 +07:00
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>
This commit is contained in:
parent
c80b0c28ca
commit
2c2f409f32
@ -2917,8 +2917,13 @@ static int __devinit cxgb_enable_msix(struct adapter *adap)
|
|||||||
while ((err = pci_enable_msix(adap->pdev, entries, vectors)) > 0)
|
while ((err = pci_enable_msix(adap->pdev, entries, vectors)) > 0)
|
||||||
vectors = err;
|
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;
|
err = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
for (i = 0; i < vectors; ++i)
|
for (i = 0; i < vectors; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user