PCI: cpcihp: Check pci_hp_add_bridge() return value
Subsystems (2)
PATCH 1/1 PCI: cpcihp: Check pci_hp_add_bridge() return value
cpci_configure_slot() ignores the return value of pci_hp_add_bridge() and continues with resource assignment and device addition even if bridge setup fails.
Check the return value, report the error, and abort slot configuration if adding the bridge fails.
Compile-tested only.
Signed-off-by Brody England <[email protected]>
--- drivers/pci/hotplug/cpci_hotplug_pci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/pci/hotplug/cpci_hotplug_pci.c +8 -2
@@ -269,8 +269,14 @@ int cpci_configure_slot(struct slot *slot) parent = slot->dev->bus;for_each_pci_bridge (dev, parent) { -if (PCI_SLOT (dev->devfn) ==PCI_SLOT (slot->devfn)) -pci_hp_add_bridge (dev); +if (PCI_SLOT (dev->devfn) ==PCI_SLOT (slot->devfn)) { + ret =pci_hp_add_bridge (dev); +if (ret) { +err ("Could not add hotplug bridge for slot %02x" , + slot->number); + goto out; + } + } }pci_assign_unassigned_bridge_resources (parent->self);
Signature · 1 line
2.47.3