summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-12-15 05:52:16 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-12-15 05:52:16 +0000
commitff4d7161af412c5cc8f5435c5ec6b6cbb14a1136 (patch)
treecddf9535f5761465448a6f82f18cb4e79edb7f5d
parent96d65874af6dbb465d73859b49546e3f334e2a79 (diff)
//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 <eich@freedesktop.org>
-rw-r--r--hw/xfree86/os-support/bus/Pci.c5
1 files changed, 4 insertions, 1 deletions
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