aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/acpi.c b/hw/acpi.c
index 437313309f..d73aee99ae 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -695,11 +695,11 @@ static uint32_t pciej_read(void *opaque, uint32_t addr)
static void pciej_write(void *opaque, uint32_t addr, uint32_t val)
{
BusState *bus = opaque;
- DeviceState *qdev;
+ DeviceState *qdev, *next;
PCIDevice *dev;
int slot = ffs(val) - 1;
- QLIST_FOREACH(qdev, &bus->children, sibling) {
+ QLIST_FOREACH_SAFE(qdev, &bus->children, sibling, next) {
dev = DO_UPCAST(PCIDevice, qdev, qdev);
if (PCI_SLOT(dev->devfn) == slot) {
#if defined (TARGET_I386)