Skip to content

Commit

Permalink
PCI: check if bus has a proper bridge device before triggering SBR
Browse files Browse the repository at this point in the history
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 <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Yu Zhao authored and Jesse Barnes committed Jun 29, 2009
1 parent 977badb commit 654b75e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 654b75e

Please sign in to comment.