summaryrefslogtreecommitdiffstats
path: root/hw/char
diff options
context:
space:
mode:
authorPeter Crosthwaite2014-06-18 09:56:31 +0200
committerAndreas Färber2014-07-01 04:02:53 +0200
commitf173d57a4cd3bb2a8362fe376cd9fd776b2f57d5 (patch)
treef4b392449f53293e948ec32edbbfc01865bb78ca /hw/char
parenthw: Fix qemu_allocate_irqs() leaks (diff)
downloadqemu-f173d57a4cd3bb2a8362fe376cd9fd776b2f57d5.tar.gz
qemu-f173d57a4cd3bb2a8362fe376cd9fd776b2f57d5.tar.xz
qemu-f173d57a4cd3bb2a8362fe376cd9fd776b2f57d5.zip
irq: Allocate IRQs individually
Allocate each IRQ individually on array allocations. This prepares for QOMification of IRQs, where pointers to individual IRQs may be taken and handed around for usage as QOM Links. The g_renew() scheme used here is too fragile and would break all existing links should an IRQ list be extended. We now have to pass the IRQ count to qemu_free_irqs(). We have so few call sites however, so this change is reasonably trivial. Cc: agarcia@igalia.com Cc: mst@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alberto Garcia <agarcia@igalia.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/serial-pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 6c252966d5..f53bb9c5d0 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -152,7 +152,7 @@ static void multi_serial_pci_exit(PCIDevice *dev)
g_free(pci->name[i]);
}
memory_region_destroy(&pci->iobar);
- qemu_free_irqs(pci->irqs);
+ qemu_free_irqs(pci->irqs, pci->ports);
}
static const VMStateDescription vmstate_pci_serial = {