[prev in list] [next in list] [prev in thread] [next in thread]
List: xen-cvs
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] ide: don't leak irq array in pci_cmd646_ide_init()
From: patchbot () xen ! org
Date: 2015-10-29 15:37:58
Message-ID: E1ZrpH4-0004ks-UG () xenbits ! xen ! org
[Download RAW message or body]
commit a979f2dcfab505ca77e5fd5f644bb0a705bae724
Author: Yunlei Ding <yunlei.ding@citrix.com>
AuthorDate: Fri Apr 18 06:11:30 2014 +0100
Commit: Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 16:52:07 2015 +0100
ide: don't leak irq array in pci_cmd646_ide_init()
Call qemu_allocate_irq() twice instead of qemu_allocate_irqs to
allocate memory.
Signed-off-by: Yunlei Ding <yunlei.ding@citrix.com>
(defects not identified by Coverity Scan)
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
hw/ide.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/ide.c b/hw/ide.c
index 4c30edd..e4ad360 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3676,7 +3676,6 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
PCIIDEState *d;
uint8_t *pci_conf;
int i;
- qemu_irq *irq;
d = (PCIIDEState *)pci_register_device(bus, "CMD646 IDE",
sizeof(PCIIDEState),
@@ -3718,9 +3717,8 @@ void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
for(i = 0; i < 4; i++)
d->ide_if[i].pci_dev = (PCIDevice *)d;
- irq = qemu_allocate_irqs(cmd646_set_irq, d, 2);
- ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], irq[0]);
- ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], irq[1]);
+ ide_init2(&d->ide_if[0], hd_table[0], hd_table[1], qemu_allocate_irq(cmd646_set_irq, d));
+ ide_init2(&d->ide_if[2], hd_table[2], hd_table[3], qemu_allocate_irq(cmd646_set_irq, d));
register_savevm("ide", 0, 3, pci_ide_save, pci_ide_load, d);
qemu_register_reset(cmd646_reset, d);
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic