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