mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-10-04 15:58:29 +00:00
kvm tools: Initialize irq_routing before using it
Initialize irq_routing, and specifically irq_routing->nr before using it. Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
@@ -140,8 +140,8 @@ void irq__init(struct kvm *kvm)
|
||||
{
|
||||
int i, r;
|
||||
|
||||
irq_routing = malloc(sizeof(struct kvm_irq_routing) +
|
||||
IRQ_MAX_GSI * sizeof(struct kvm_irq_routing_entry));
|
||||
irq_routing = calloc(sizeof(struct kvm_irq_routing) +
|
||||
IRQ_MAX_GSI * sizeof(struct kvm_irq_routing_entry), 1);
|
||||
if (irq_routing == NULL)
|
||||
die("Failed allocating space for GSI table");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user