netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH NEXT 1/1] qlcnic: fix pci resource leak
@ 2010-07-17  7:39 amit.salecha
  2010-07-18 21:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: amit.salecha @ 2010-07-17  7:39 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, Amit Kumar Salecha

From: Amit Kumar Salecha <amit.salecha@qlogic.com>

pci_get_domain_bus_and_slot: caller must decrement the
reference count by calling pci_dev_put().

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 8d2d62f..f1f7acf 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2695,9 +2695,14 @@ static int qlcnic_is_first_func(struct pci_dev *pdev)
 		oth_pdev = pci_get_domain_bus_and_slot(pci_domain_nr
 			(pdev->bus), pdev->bus->number,
 			PCI_DEVFN(PCI_SLOT(pdev->devfn), val));
+		if (!oth_pdev)
+			continue;
 
-		if (oth_pdev && (oth_pdev->current_state != PCI_D3cold))
+		if (oth_pdev->current_state != PCI_D3cold) {
+			pci_dev_put(oth_pdev);
 			return 0;
+		}
+		pci_dev_put(oth_pdev);
 	}
 	return 1;
 }
-- 
1.6.0.2


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

* Re: [PATCH NEXT 1/1] qlcnic: fix pci resource leak
  2010-07-17  7:39 [PATCH NEXT 1/1] qlcnic: fix pci resource leak amit.salecha
@ 2010-07-18 21:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-07-18 21:52 UTC (permalink / raw)
  To: amit.salecha; +Cc: netdev, ameen.rahman

From: amit.salecha@qlogic.com
Date: Sat, 17 Jul 2010 00:39:38 -0700

> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
> 
> pci_get_domain_bus_and_slot: caller must decrement the
> reference count by calling pci_dev_put().
> 
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>

Applied, thanks.

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

end of thread, other threads:[~2010-07-18 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-17  7:39 [PATCH NEXT 1/1] qlcnic: fix pci resource leak amit.salecha
2010-07-18 21:52 ` 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).