From ff4d7161af412c5cc8f5435c5ec6b6cbb14a1136 Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Wed, 15 Dec 2004 05:52:16 +0000 Subject: [PATCH] //bugs.freedesktop.org/show_bug.cgi?id=1965) attachment #1425 (https://bugs.freedesktop.org/attachment.cgi?id=1425): Avoid recursive calls of xf86scanpci(). This function normally detects that it has been called before by checking if the PCI structure is filled out. So far if this was not the case (because PCI probing has failed for some reason) the function is traversed again. With the chipset specific PCI bus probing this can lead to an endless recursive loop as the post-probing code calls xf86scanpci() from within this function. Patch by Egbert Eich --- hw/xfree86/os-support/bus/Pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index ffa906505..4bc189bbd 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -954,10 +954,13 @@ xf86scanpci(int flags) pciBusInfo_t *busp; int idx = 0, i; PCITAG tag; + static Bool done = FALSE; - if (pci_devp[0]) + if (done || pci_devp[0]) return pci_devp; + done = TRUE; + pciInit(); #ifdef XF86SCANPCI_WRAPPER