We have to release already allocated resources if ioapic_get_or_add_phys
fails. At least the arch.ioapics array should be freed again, but
possibly also previously claimed root cell IOAPIC pins.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
for (n = 0; n < cell->config->num_irqchips; n++, irqchip++) {
phys_ioapic = ioapic_get_or_add_phys(irqchip);
- if (!phys_ioapic)
+ if (!phys_ioapic) {
+ ioapic_cell_exit(cell);
return -ENOMEM;
+ }
ioapic = &cell->arch.ioapics[n];
ioapic->info = irqchip;