From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Anthony Liguori <anthony@codemonkey.ws>,
Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL 2/4] s390x/cpu hotplug: Fix memory leak
Date: Mon, 17 Mar 2014 22:38:25 +0100 [thread overview]
Message-ID: <1395092307-42208-3-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1395092307-42208-1-git-send-email-borntraeger@de.ibm.com>
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>
---
hw/s390x/sclpcpu.c | 6 +++---
1 file 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;
}
--
1.8.4.2
next prev parent reply other threads:[~2014-03-17 21:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 21:38 [Qemu-devel] [PULL 0/4] s390/kvm: Small fixes for 2.0 Christian Borntraeger
2014-03-17 21:38 ` [Qemu-devel] [PULL 1/4] s390/ipl: Fix error path on BIOS loading Christian Borntraeger
2014-03-17 21:38 ` Christian Borntraeger [this message]
2014-03-17 21:38 ` [Qemu-devel] [PULL 3/4] s390x/sclpconsole: Fix and simplify interrupt injection Christian Borntraeger
2014-03-17 21:38 ` [Qemu-devel] [PULL 4/4] s390x/sclpconsole-lm: Fix and simplify irq setup Christian Borntraeger
2014-03-17 22:46 ` [Qemu-devel] [PULL 0/4] s390/kvm: Small fixes for 2.0 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395092307-42208-3-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=anthony@codemonkey.ws \
--cc=cornelia.huck@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).