mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
f3c7d0389f
commit
f173d57a4c
5 changed files with 11 additions and 17 deletions
|
@ -949,7 +949,7 @@ static void device_finalize(Object *obj)
|
|||
|
||||
QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {
|
||||
QLIST_REMOVE(ngl, node);
|
||||
qemu_free_irqs(ngl->in);
|
||||
qemu_free_irqs(ngl->in, ngl->num_in);
|
||||
g_free(ngl->name);
|
||||
g_free(ngl);
|
||||
/* ngl->out irqs are owned by the other end and should not be freed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue