Skip to content

Commit

Permalink
qlcnic: fix pci resource leak
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Amit Kumar Salecha authored and David S. Miller committed Jul 18, 2010
1 parent 4a1745f commit bfc978f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bfc978f

Please sign in to comment.