[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/30] hw/ide/pci: Fix memory leak
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 06/30] hw/ide/pci: Fix memory leak |
Date: |
Wed, 3 Jun 2015 16:08:26 +0300 |
From: Shannon Zhao <address@hidden>
valgrind complains about:
==16447== 16 bytes in 2 blocks are definitely lost in loss record 1,304 of 3,310
==16447== at 0x4C2845D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16447== by 0x2E4FD7: malloc_and_trace (vl.c:2546)
==16447== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==16447== by 0x36FB47: qemu_extend_irqs (irq.c:55)
==16447== by 0x36FBD3: qemu_allocate_irqs (irq.c:64)
==16447== by 0x3B4B44: bmdma_init (pci.c:464)
==16447== by 0x3B547B: pci_piix_init_ports (piix.c:144)
==16447== by 0x3B55D2: pci_piix_ide_realize (piix.c:164)
==16447== by 0x3EAEC6: pci_qdev_realize (pci.c:1790)
==16447== by 0x36C685: device_set_realized (qdev.c:1058)
==16447== by 0x47179E: property_set_bool (object.c:1514)
==16447== by 0x470098: object_property_set (object.c:837)
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/ide/pci.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 1b3d1c1..4b5e32d 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -452,8 +452,6 @@ static const struct IDEDMAOps bmdma_ops = {
void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
{
- qemu_irq *irq;
-
if (bus->dma == &bm->dma) {
return;
}
@@ -461,8 +459,7 @@ void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
bm->dma.ops = &bmdma_ops;
bus->dma = &bm->dma;
bm->irq = bus->irq;
- irq = qemu_allocate_irqs(bmdma_irq, bm, 1);
- bus->irq = *irq;
+ bus->irq = qemu_allocate_irq(bmdma_irq, bm, 0);
bm->pci_dev = d;
}
--
2.1.4
- [Qemu-devel] [PULL 07/30] hw/i386/acpi-build: decref after use, (continued)
- [Qemu-devel] [PULL 07/30] hw/i386/acpi-build: decref after use, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 10/30] hw/alpha/dp264.c: Fix memory leak spotted by valgrind, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 03/30] util: socket: Add missing localaddr and localport option for DGRAM socket, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 05/30] hw/i386/pc_piix: Fix memory leak, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 04/30] docs/writing-qmp-commands: fix a typo, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 17/30] hw/timer/arm_timer.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 08/30] device-tree: Make a common-obj, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 28/30] slirp: use less predictable directory name in /tmp for smb config (CVE-2015-4037), Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 15/30] hw/isa/lpc_ich9.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 24/30] hw/arm/nseries.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 06/30] hw/ide/pci: Fix memory leak,
Michael Tokarev <=
- [Qemu-devel] [PULL 25/30] hw/display/tc6393xb.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 22/30] hw/unicore32/puv3.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 29/30] cadence_gem: Fix Rx buffer size field mask, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 18/30] hw/sparc/sun4m.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 20/30] hw/lm32/lm32_boards.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 30/30] configure: postfix --extra-cflags to QEMU_CFLAGS, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 23/30] hw/alpha/typhoon.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 13/30] hw/intc/exynos4210_gic.c: Fix memory leak by adjusting order, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 16/30] hw/isa/i82378.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03
- [Qemu-devel] [PULL 19/30] hw/ppc/prep.c: Fix misusing qemu_allocate_irqs for single irq, Michael Tokarev, 2015/06/03