diff options
author | Philippe Mathieu-Daudé | 2022-08-19 17:39:27 +0200 |
---|---|---|
committer | Peter Maydell | 2022-09-22 17:38:28 +0200 |
commit | 7650c8fe520c67c3b36f6962c4ad990f56ad40b8 (patch) | |
tree | 1e8fceae7f953f303ea6e676f24892651b246531 /hw/intc/xics.c | |
parent | hw/ppc/pnv: Avoid dynamic stack allocation (diff) | |
download | qemu-7650c8fe520c67c3b36f6962c4ad990f56ad40b8.tar.gz qemu-7650c8fe520c67c3b36f6962c4ad990f56ad40b8.tar.xz qemu-7650c8fe520c67c3b36f6962c4ad990f56ad40b8.zip |
hw/intc/xics: Avoid dynamic stack allocation
Use autofree heap allocation instead of variable-length
array on the stack.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220819153931.3147384-8-peter.maydell@linaro.org
Diffstat (limited to 'hw/intc/xics.c')
-rw-r--r-- | hw/intc/xics.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 5b0b4d9624..dcd021af66 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -567,8 +567,8 @@ static void ics_reset_irq(ICSIRQState *irq) static void ics_reset(DeviceState *dev) { ICSState *ics = ICS(dev); + g_autofree uint8_t *flags = g_malloc(ics->nr_irqs); int i; - uint8_t flags[ics->nr_irqs]; for (i = 0; i < ics->nr_irqs; i++) { flags[i] = ics->irqs[i].flags; |