@@ -258,7 +258,6 @@ int kvm_add_routing_entry(struct kvm_irq_routing_entry *entry,
{
#ifdef KVM_CAP_IRQ_ROUTING
KVMState *s = kvm_state;
- struct kvm_irq_routing *z;
struct kvm_irq_routing_entry *new;
int n, size;
@@ -269,12 +268,8 @@ int kvm_add_routing_entry(struct kvm_irq_routing_entry *entry,
}
size = sizeof(struct kvm_irq_routing);
size += n * sizeof(*new);
- z = realloc(s->irq_routes, size);
- if (!z) {
- return -ENOMEM;
- }
+ s->irq_routes = g_realloc(s->irq_routes, size);
s->nr_allocated_irq_routes = n;
- s->irq_routes = z;
s->msi_cache = g_realloc(s->msi_cache, sizeof(*s->msi_cache) * n);
}
Allows to drop checking for out-of-memory. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- qemu-kvm.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)