ia64/xen-unstable

changeset 18076:c9880c5a06eb

ioemu: fix the devices loop.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jul 17 11:20:01 2008 +0100 (2008-07-17)
parents cdece2b30df6
children 23208dc42cfe
files tools/ioemu/hw/pci.c
line diff
     1.1 --- a/tools/ioemu/hw/pci.c	Thu Jul 17 11:17:32 2008 +0100
     1.2 +++ b/tools/ioemu/hw/pci.c	Thu Jul 17 11:20:01 2008 +0100
     1.3 @@ -644,17 +644,21 @@ PCIBus *pci_bridge_init(PCIBus *bus, int
     1.4  
     1.5  int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr, uint32_t size)
     1.6  {
     1.7 -    PCIDevice *devices = (PCIDevice *)bus->devices;
     1.8 +    PCIDevice *devices = NULL;
     1.9      PCIIORegion *r;
    1.10      int ret = 0;
    1.11      int i, j;
    1.12  
    1.13      /* check Overlapped to Base Address */
    1.14 -    for (i=0; i<256; i++, devices++)
    1.15 +    for (i=0; i<256; i++)
    1.16      {
    1.17 -        if ((devices == NULL) || (devices->devfn == devfn))
    1.18 +        if ( !(devices = bus->devices[i]) )
    1.19              continue;
    1.20  
    1.21 +        /* skip itself */
    1.22 +        if (devices->devfn == devfn)
    1.23 +            continue;
    1.24 +        
    1.25          for (j=0; j<PCI_NUM_REGIONS; j++)
    1.26          {
    1.27              r = &devices->io_regions[j];