aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2014-03-10 15:03:16 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-03-17 22:01:19 +0100
commit7b53f2940e3bf43ae50c929330a4837ca4da7a94 (patch)
tree1e6aa99a8db1a697ee646e90051cad1825a31e74 /hw/s390x
parent0a1bec8a4e1c55bb581521c60db30e3f4867ceb1 (diff)
downloadqemu-7b53f2940e3bf43ae50c929330a4837ca4da7a94.zip
qemu-7b53f2940e3bf43ae50c929330a4837ca4da7a94.tar.gz
qemu-7b53f2940e3bf43ae50c929330a4837ca4da7a94.tar.bz2
s390x/cpu hotplug: Fix memory leak
valgrind complains about the following: ==42117== 8 bytes in 1 blocks are definitely lost in loss record 88 of 833 ==42117== at 0x4031AFE: malloc (vg_replace_malloc.c:292) ==42117== by 0x8022F855: malloc_and_trace (vl.c:2715) ==42117== by 0x4145569: g_malloc (in /usr/lib64/libglib-2.0.so.0.3400.2) ==42117== by 0x800F696D: qemu_extend_irqs (irq.c:51) ==42117== by 0x800F6AF7: qemu_allocate_irqs (irq.c:68) ==42117== by 0x8029FA4B: irq_cpu_hotplug_init (sclpcpu.c:84) ==42117== by 0x80297C79: event_realize (event-facility.c:386) ==42117== by 0x80105071: device_set_realized (qdev.c:693) [...] Right it is. Don't drop the pointer of the irq. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Jason J. Herne <jjherne@us.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/sclpcpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/s390x/sclpcpu.c b/hw/s390x/sclpcpu.c
index b9c238a..3600fe2 100644
--- a/hw/s390x/sclpcpu.c
+++ b/hw/s390x/sclpcpu.c
@@ -25,13 +25,13 @@ typedef struct ConfigMgtData {
uint8_t event_qualifier;
} QEMU_PACKED ConfigMgtData;
-static qemu_irq irq_cpu_hotplug; /* Only used in this file */
+static qemu_irq *irq_cpu_hotplug; /* Only used in this file */
#define EVENT_QUAL_CPU_CHANGE 1
void raise_irq_cpu_hotplug(void)
{
- qemu_irq_raise(irq_cpu_hotplug);
+ qemu_irq_raise(*irq_cpu_hotplug);
}
static unsigned int send_mask(void)
@@ -81,7 +81,7 @@ static void trigger_signal(void *opaque, int n, int level)
static int irq_cpu_hotplug_init(SCLPEvent *event)
{
- irq_cpu_hotplug = *qemu_allocate_irqs(trigger_signal, event, 1);
+ irq_cpu_hotplug = qemu_allocate_irqs(trigger_signal, event, 1);
return 0;
}