115cc5
--- xorg-server-1.1.1/hw/xfree86/os-support/bus/Pci.c.jx	2007-02-12 11:08:52.000000000 -0500
115cc5
+++ xorg-server-1.1.1/hw/xfree86/os-support/bus/Pci.c	2007-03-30 12:20:08.000000000 -0400
115cc5
@@ -231,14 +231,14 @@
115cc5
 int            pciMaxBusNum = MAX_PCI_BUSES;
115cc5
 static Bool    inProbe = FALSE;
115cc5
 
115cc5
-static pciConfigPtr pci_devp[MAX_PCI_DEVICES + 1] = {NULL, };
115cc5
+static pciConfigPtr *pci_devp = NULL;
115cc5
 
115cc5
 static int readPciBios( PCITAG Tag, CARD8* tmp, ADDRESS hostbase,
115cc5
 			unsigned char * buf, int len, PciBiosType BiosType );
115cc5
 
115cc5
 static int (*pciOSHandleBIOS)(PCITAG Tag, int basereg, unsigned char *buf, int len);
115cc5
 
115cc5
-int xf86MaxPciDevs = MAX_PCI_DEVICES;
115cc5
+int xf86MaxPciDevs = 0;
115cc5
 
115cc5
 /*
115cc5
  * Platform specific PCI function pointers.
115cc5
@@ -271,6 +271,11 @@
115cc5
 	if (pciNumBuses <= 0)
115cc5
 	    ARCH_PCI_OS_INIT();
115cc5
 #endif
115cc5
+	if (xf86MaxPciDevs == 0)
115cc5
+	    xf86MaxPciDevs = MAX_PCI_DEVICES; /* XXX bogus */
115cc5
+	if (pci_devp)
115cc5
+	    xfree(pci_devp);
115cc5
+	pci_devp = xnfcalloc(xf86MaxPciDevs + 1, sizeof(pciConfigPtr));
115cc5
 }
115cc5
 
115cc5
 void pciSetOSBIOSPtr(int (*bios_fn)(PCITAG Tag, int basereg, unsigned char * buf, int len))
115cc5
@@ -913,7 +918,7 @@
115cc5
      * result in an endless recursion if platform/OS specific PCI
115cc5
      * bus probing code calls this function from with in it.
115cc5
      */
115cc5
-    if (done || pci_devp[0])
115cc5
+    if (done || pci_devp)
115cc5
 	return pci_devp;
115cc5
 
115cc5
     done = TRUE;