pmu: fix pmu vmstate subsection list
authorLaurent Vivier <lvivier@redhat.com>
Tue, 16 Nov 2021 15:08:37 +0000 (16:08 +0100)
committerCédric Le Goater <clg@kaod.org>
Wed, 17 Nov 2021 18:10:44 +0000 (19:10 +0100)
The subsection is not closed by a NULL marker so this can trigger
a segfault when the pmu vmstate is saved.

This can be easily shown with:

  $ ./qemu-system-ppc64  -dump-vmstate vmstate.json
  Segmentation fault (core dumped)

Fixes: d811d61fbc6c ("mac_newworld: add PMU device")
Cc: mark.cave-ayland@ilande.co.uk
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/misc/macio/pmu.c

index 4ad4f50e08c33f4b3e80fc9b49237a23e41581b9..eb39c64694aa3a93dd9edcf2538e9b0f7d363359 100644 (file)
@@ -718,6 +718,7 @@ static const VMStateDescription vmstate_pmu = {
     },
     .subsections = (const VMStateDescription * []) {
         &vmstate_pmu_adb,
+        NULL
     }
 };