Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-16 16:12:15 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-16 16:12:21 +0200
commitdca7c0c8c87cd155226b7011cbd15b3e3318111f (patch)
tree83f55dde6c5ba757c630f8ee5f03365858995f1d
parentb41b68d138271a3599a941eb86d6d3aa2e607053 (diff)
PCI: Return error if cannot probe VF (bsc#1051510).
-rw-r--r--drivers/pci/pci-driver.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 112576f6707e..976c24a98934 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -412,17 +412,18 @@ static int pci_device_probe(struct device *dev)
struct pci_dev *pci_dev = to_pci_dev(dev);
struct pci_driver *drv = to_pci_driver(dev->driver);
+ if (!pci_device_can_probe(pci_dev))
+ return -ENODEV;
+
error = pcibios_alloc_irq(pci_dev);
if (error < 0)
return error;
pci_dev_get(pci_dev);
- if (pci_device_can_probe(pci_dev)) {
- error = __pci_device_probe(drv, pci_dev);
- if (error) {
- pcibios_free_irq(pci_dev);
- pci_dev_put(pci_dev);
- }
+ error = __pci_device_probe(drv, pci_dev);
+ if (error) {
+ pcibios_free_irq(pci_dev);
+ pci_dev_put(pci_dev);
}
return error;