hw/char/{diva-gsp, serial-pci-multi}: Fix deinitialization order
The memory region is owned by the device being unrealized, so must be removed from the mapping before unrealizing. Fixes: d66bbea4e0d3 ("serial: add 2x + 4x pci variant") Fixes: 274074708455 ("hw/char: Add emulation of Diva GSP PCI management boards") Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Bernhard Beschow <shentey@gmail.com> Message-ID: <20260305220911.131508-3-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Bernhard Beschow committed
Mar 5, 2026 at 23:08 UTC
7e68ad18f5642e87a5970b0f45fc0d8c0ed22fd9
2 files changed
+2
-2
hw/char/diva-gsp.c
+1
-1
@@ -62,8 +62,8 @@ static void diva_pci_exit(PCIDevice *dev)
62
63
for (i = 0; i < pci->ports; i++) {
64
s = pci->state + i;
65
- qdev_unrealize(DEVICE(s));
65
memory_region_del_subregion(&pci->membar, &s->io);
66
+ qdev_unrealize(DEVICE(s));
67
g_free(pci->name[i]);
68
}
69
qemu_free_irqs(pci->irqs, pci->ports);
hw/char/serial-pci-multi.c
+1
-1
@@ -56,8 +56,8 @@ static void multi_serial_pci_exit(PCIDevice *dev)
56
57
for (i = 0; i < pci->ports; i++) {
58
s = pci->state + i;
59
- qdev_unrealize(DEVICE(s));
59
memory_region_del_subregion(&pci->iobar, &s->io);
60
+ qdev_unrealize(DEVICE(s));
61
g_free(pci->name[i]);
62
}
63
}