From: Keir Fraser Date: Thu, 17 Jul 2008 10:20:01 +0000 (+0100) Subject: ioemu: fix the devices loop. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14188^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=470831aeb214c23d380b20fb1b81c42a4559b94d;p=xen.git ioemu: fix the devices loop. Signed-off-by: Jean Guyader Signed-off-by: Yuji Shimada --- diff --git a/tools/ioemu/hw/pci.c b/tools/ioemu/hw/pci.c index 4f55d1da07..b68dd3f91a 100644 --- a/tools/ioemu/hw/pci.c +++ b/tools/ioemu/hw/pci.c @@ -644,17 +644,21 @@ PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id, int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr, uint32_t size) { - PCIDevice *devices = (PCIDevice *)bus->devices; + PCIDevice *devices = NULL; PCIIORegion *r; int ret = 0; int i, j; /* check Overlapped to Base Address */ - for (i=0; i<256; i++, devices++) + for (i=0; i<256; i++) { - if ((devices == NULL) || (devices->devfn == devfn)) + if ( !(devices = bus->devices[i]) ) continue; + /* skip itself */ + if (devices->devfn == devfn) + continue; + for (j=0; jio_regions[j];