From: Yu Zhao Date: Fri, 26 Jun 2009 06:04:46 +0000 (+0800) Subject: PCI: check if bus has a proper bridge device before triggering SBR X-Git-Tag: MMI-PSA29.97-13-9~27470^2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=654b75e044119bf8e7d773bce41ea039281bbfbe;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git PCI: check if bus has a proper bridge device before triggering SBR For devices attached to the root bus, we can't trigger Secondary Bus Reset because there is no bridge device associated with the bus. So need to check bus->self again NULL first before using it. Reviewed-by: Kenji Kaneshige Signed-off-by: Yu Zhao Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6c93af5ced18..d5d6f5667d83 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2171,7 +2171,7 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe) u16 ctrl; struct pci_dev *pdev; - if (dev->subordinate) + if (pci_is_root_bus(dev->bus) || dev->subordinate || !dev->bus->self) return -ENOTTY; list_for_each_entry(pdev, &dev->bus->devices, bus_list)