]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Make pci_scan_slot more robust
authorMatthew Wilcox <matthew@wil.cx>
Sun, 17 Jan 2010 21:01:41 +0000 (14:01 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 23 Feb 2010 00:17:17 +0000 (16:17 -0800)
commitf5daf9810bb3c56e02bd7cc02b008e28469aa86b
treecd2d6ff98626d6d8782edd848c357bc4607ece17
parent109be89a5d1420adea4d86782ae36059e641c40f
PCI: Make pci_scan_slot more robust

Yinghai pointed out that the new pci_scan_slot() crashes when called
on an ARI-capable slot that is empty.  Fix this by exiting early from
pci_scan_slot if there is no device in the slot.

Also make next_ari_func() robust against devices not existing in case
the ARI capability is corrupt.  ARI also requires that the devices be
listed in order, so if we find a function listed that is out of order,
stop scanning to prevent loops.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/probe.c