qlcnic: fix pci resource leak
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>
This commit is contained in:
committed by
David S. Miller
parent
4a1745fc54
commit
bfc978fa5f
@ -2695,10 +2695,15 @@ static int qlcnic_is_first_func(struct pci_dev *pdev)
|
|||||||
oth_pdev = pci_get_domain_bus_and_slot(pci_domain_nr
|
oth_pdev = pci_get_domain_bus_and_slot(pci_domain_nr
|
||||||
(pdev->bus), pdev->bus->number,
|
(pdev->bus), pdev->bus->number,
|
||||||
PCI_DEVFN(PCI_SLOT(pdev->devfn), val));
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
pci_dev_put(oth_pdev);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user