[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen-unstable] ide: don't leak irq array in pci_cmd646_ide_init()
commit a979f2dcfab505ca77e5fd5f644bb0a705bae724 Author: Yunlei Ding <yunlei.ding@xxxxxxxxxx> AuthorDate: Fri Apr 18 06:11:30 2014 +0100 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> 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@xxxxxxxxxx> (defects not identified by Coverity Scan) Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- 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-unstable.git _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |