[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] ioemu: fix the devices loop.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216290001 -3600
# Node ID c9880c5a06eb7bcfca09ea9c4449da60f827283e
# Parent  cdece2b30df61497e9acbbd8710604797c366612
ioemu: fix the devices loop.

Signed-off-by: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
---
 tools/ioemu/hw/pci.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff -r cdece2b30df6 -r c9880c5a06eb tools/ioemu/hw/pci.c
--- a/tools/ioemu/hw/pci.c      Thu Jul 17 11:17:32 2008 +0100
+++ b/tools/ioemu/hw/pci.c      Thu Jul 17 11:20:01 2008 +0100
@@ -644,17 +644,21 @@ PCIBus *pci_bridge_init(PCIBus *bus, int
 
 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; j<PCI_NUM_REGIONS; j++)
         {
             r = &devices->io_regions[j];

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.