PCI: Fix faulty logic in pci_reset_bus()
The pci_reset_bus() function calls pci_probe_reset_slot() to determine
whether to call the slot or bus reset. The check has faulty logic in that
it does not account for pci_probe_reset_slot() being able to return an
errno. Fix by only calling the slot reset when the function returns 0.
Fixes: 811c5cb37d
("PCI: Unify try slot and bus reset API")
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Cc: Sinan Kaya <okaya@codeaurora.org>
This commit is contained in:
parent
34fb6bf9b1
commit
d8a5281035
@ -5200,7 +5200,7 @@ static int __pci_reset_bus(struct pci_bus *bus)
|
|||||||
*/
|
*/
|
||||||
int pci_reset_bus(struct pci_dev *pdev)
|
int pci_reset_bus(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
return pci_probe_reset_slot(pdev->slot) ?
|
return (!pci_probe_reset_slot(pdev->slot)) ?
|
||||||
__pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
|
__pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(pci_reset_bus);
|
EXPORT_SYMBOL_GPL(pci_reset_bus);
|
||||||
|
Loading…
Reference in New Issue
Block a user