diff mbox

[10/10] hw/openrisc/pic_cpu.c: use qemu_allocate_irq to fix memory leak

Message ID 1435830563-3072-11-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao July 2, 2015, 9:49 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 hw/openrisc/pic_cpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/hw/openrisc/pic_cpu.c b/hw/openrisc/pic_cpu.c
index 2af1d60..5060214 100644
--- a/hw/openrisc/pic_cpu.c
+++ b/hw/openrisc/pic_cpu.c
@@ -51,10 +51,8 @@  static void openrisc_pic_cpu_handler(void *opaque, int irq, int level)
 void cpu_openrisc_pic_init(OpenRISCCPU *cpu)
 {
     int i;
-    qemu_irq *qi;
-    qi = qemu_allocate_irqs(openrisc_pic_cpu_handler, cpu, NR_IRQS);
 
     for (i = 0; i < NR_IRQS; i++) {
-        cpu->env.irq[i] = qi[i];
+        cpu->env.irq[i] = qemu_allocate_irq(openrisc_pic_cpu_handler, cpu, i);
     }
 }