aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr_events.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ppc/spapr_events.c')
-rw-r--r--hw/ppc/spapr_events.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 66b8164f30..e377fc7dde 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -702,9 +702,9 @@ static void event_scan(PowerPCCPU *cpu, sPAPRMachineState *spapr,
void spapr_clear_pending_events(sPAPRMachineState *spapr)
{
- sPAPREventLogEntry *entry = NULL;
+ sPAPREventLogEntry *entry = NULL, *next_entry;
- QTAILQ_FOREACH(entry, &spapr->pending_events, next) {
+ QTAILQ_FOREACH_SAFE(entry, &spapr->pending_events, next, next_entry) {
QTAILQ_REMOVE(&spapr->pending_events, entry, next);
g_free(entry->extended_log);
g_free(entry);