[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/29] hw/arm/nseries.c: Fix memory leak spotted by
From: |
Shannon Zhao |
Subject: |
[Qemu-devel] [PATCH 23/29] hw/arm/nseries.c: Fix memory leak spotted by valgrind |
Date: |
Thu, 28 May 2015 20:08:46 +0800 |
From: Shannon Zhao <address@hidden>
valgrind complains about:
==4835== 8 bytes in 1 blocks are definitely lost in loss record 509 of 3,278
==4835== at 0x4C2845D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==4835== by 0x354793: malloc_and_trace (vl.c:2556)
==4835== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==4835== by 0x3ED98F: qemu_extend_irqs (irq.c:55)
==4835== by 0x3EDA1B: qemu_allocate_irqs (irq.c:64)
==4835== by 0x280261: n8x0_gpio_setup (nseries.c:136)
==4835== by 0x2830AB: n8x0_init (nseries.c:1337)
==4835== by 0x2832D6: n800_init (nseries.c:1409)
==4835== by 0x358B5E: main (vl.c:4249)
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
---
hw/arm/nseries.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index d243159..2e392a9 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -133,8 +133,8 @@ static void n800_mmc_cs_cb(void *opaque, int line, int
level)
static void n8x0_gpio_setup(struct n800_s *s)
{
- qemu_irq *mmc_cs = qemu_allocate_irqs(n800_mmc_cs_cb, s->mpu->mmc, 1);
- qdev_connect_gpio_out(s->mpu->gpio, N8X0_MMC_CS_GPIO, mmc_cs[0]);
+ qemu_irq mmc_cs = qemu_allocate_irq(n800_mmc_cs_cb, s->mpu->mmc, 0);
+ qdev_connect_gpio_out(s->mpu->gpio, N8X0_MMC_CS_GPIO, mmc_cs);
qemu_irq_lower(qdev_get_gpio_in(s->mpu->gpio, N800_BAT_COVER_GPIO));
}
--
2.0.4
- [Qemu-devel] [PATCH 14/29] hw/mips/mips_int.c: Fix memory leak spotted by valgrind, (continued)
- [Qemu-devel] [PATCH 14/29] hw/mips/mips_int.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 11/29] hw/ppc/mac_oldworld.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 22/29] hw/alpha/typhoon.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 20/29] hw/unicore32/puv3.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 24/29] hw/arm/omap_sx1.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 21/29] hw/sh4/r2d.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 26/29] hw/arm/spitz.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 25/29] hw/arm/palm.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 23/29] hw/arm/nseries.c: Fix memory leak spotted by valgrind,
Shannon Zhao <=
- [Qemu-devel] [PATCH 29/29] hw/s390x/sclpcpu.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 27/29] hw/arm/tosa.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 28/29] hw/display/tc6393xb.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 03/29] hw/i386/pc: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28
- [Qemu-devel] [PATCH 02/29] hw/ide/cmd646.c: Fix memory leak spotted by valgrind, Shannon Zhao, 2015/05/28