cxgb3: Fix potential msi-x vector leak
Subsystems (2)
PATCH 3/4 cxgb3: Fix potential msi-x vector leak
From: Divy Le Ray <[email protected]>
Release vectors when a MSI-X allocation fails.
Signed-off-by Divy Le Ray <[email protected]>
---
drivers/net/cxgb3/cxgb3_main.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/cxgb3/cxgb3_main.c +6 -1
@@ -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)
From: Divy Le Ray <[email protected]>
Date: Fri, 17 Apr 2009 15:21:22 -0700
Quoted 3 lines
Release vectors when a MSI-X allocation fails.
Signed-off-by Divy Le Ray <[email protected]>
Applied.