Signed-off-by: Juan Quintela <quintela@xxxxxxxxxx> --- hw/device-assignment.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index e5205cf..115df19 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1106,11 +1106,7 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev, unsigned int ctrl_pos) if (ctrl_byte & PCI_MSI_FLAGS_ENABLE) { int pos = ctrl_pos - PCI_MSI_FLAGS; - assigned_dev->entry = calloc(1, sizeof(struct kvm_irq_routing_entry)); - if (!assigned_dev->entry) { - perror("assigned_dev_update_msi: "); - return; - } + assigned_dev->entry = qemu_mallocz(sizeof(*(assigned_dev->entry))); assigned_dev->entry->u.msi.address_lo = pci_get_long(pci_dev->config + pos + PCI_MSI_ADDRESS_LO); assigned_dev->entry->u.msi.address_hi = 0; @@ -1188,11 +1184,7 @@ static int assigned_dev_update_msix_mmio(PCIDevice *pci_dev) free_dev_irq_entries(adev); adev->irq_entries_nr = entries_nr; - adev->entry = calloc(entries_nr, sizeof(struct kvm_irq_routing_entry)); - if (!adev->entry) { - perror("assigned_dev_update_msix_mmio: "); - return -errno; - } + adev->entry = qemu_mallocz(entries_nr * sizeof(*(adev->entry))); msix_entry.assigned_dev_id = msix_nr.assigned_dev_id; entries_nr = 0; -- 1.7.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html