netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.30 3/4] cxgb3: Fix potential msi-x vector leak
@ 2009-04-17 22:21 Divy Le Ray
  2009-04-20  9:08 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Divy Le Ray @ 2009-04-17 22:21 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>

Release vectors when a MSI-X allocation fails.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

 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 99b5032..cbd59fe 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)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.30 3/4] cxgb3: Fix potential msi-x vector leak
  2009-04-17 22:21 [PATCH 2.6.30 3/4] cxgb3: Fix potential msi-x vector leak Divy Le Ray
@ 2009-04-20  9:08 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-04-20  9:08 UTC (permalink / raw)
  To: divy; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>
Date: Fri, 17 Apr 2009 15:21:22 -0700

> Release vectors when a MSI-X allocation fails.
> 
> Signed-off-by: Divy Le Ray <divy@chelsio.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-20  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 22:21 [PATCH 2.6.30 3/4] cxgb3: Fix potential msi-x vector leak Divy Le Ray
2009-04-20  9:08 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).