Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+[chrisw: fold in 6a4c24ec5212 to avoid printk spamming]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
This is the other half of the fix for bug #7505
- drivers/pci/search.c | 24 ++++++++++++++++++++++++
- 1 file changed, 24 insertions(+)
+ drivers/pci/search.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
--- linux-2.6.19.2.orig/drivers/pci/search.c
+++ linux-2.6.19.2/drivers/pci/search.c
-@@ -193,6 +193,18 @@ static struct pci_dev * pci_find_subsys(
+@@ -193,6 +193,15 @@ static struct pci_dev * pci_find_subsys(
struct pci_dev *dev;
WARN_ON(in_interrupt());
+ * can cause some machines to crash. So here we detect and flag that
+ * situation and bail out early.
+ */
-+ if (unlikely(list_empty(&pci_devices))) {
-+ printk(KERN_INFO "pci_find_subsys() called while pci_devices "
-+ "is still empty\n");
++ if (unlikely(list_empty(&pci_devices)))
+ return NULL;
-+ }
down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next;
-@@ -259,6 +271,18 @@ pci_get_subsys(unsigned int vendor, unsi
+@@ -259,6 +268,15 @@ pci_get_subsys(unsigned int vendor, unsi
struct pci_dev *dev;
WARN_ON(in_interrupt());
+ * can cause some machines to crash. So here we detect and flag that
+ * situation and bail out early.
+ */
-+ if (unlikely(list_empty(&pci_devices))) {
-+ printk(KERN_NOTICE "pci_get_subsys() called while pci_devices "
-+ "is still empty\n");
++ if (unlikely(list_empty(&pci_devices)))
+ return NULL;
-+ }
down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next;