diff options
author | Dennis Dalessandro <dennis.dalessandro@intel.com> | 2018-09-05 12:08:03 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-09-11 22:44:52 -0400 |
commit | d8a5281035895cdb5ff77756eff72966ec76edd0 (patch) | |
tree | fd6983c4d7a420afcc58a81be14f1ccabe5a3a4c /drivers/pci/pci.c | |
parent | 34fb6bf9b13aef4ca14224f2175ecd189e98160b (diff) |
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: 811c5cb37df4 ("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>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 29ff9619b5fa..30b260332a10 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -5200,7 +5200,7 @@ static int __pci_reset_bus(struct pci_bus *bus) | |||
5200 | */ | 5200 | */ |
5201 | int pci_reset_bus(struct pci_dev *pdev) | 5201 | int pci_reset_bus(struct pci_dev *pdev) |
5202 | { | 5202 | { |
5203 | return pci_probe_reset_slot(pdev->slot) ? | 5203 | return (!pci_probe_reset_slot(pdev->slot)) ? |
5204 | __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus); | 5204 | __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus); |
5205 | } | 5205 | } |
5206 | EXPORT_SYMBOL_GPL(pci_reset_bus); | 5206 | EXPORT_SYMBOL_GPL(pci_reset_bus); |