KVM: arm/arm64: vgic-irqfd: Fix MSI entry allocation

Using the size of the structure we're allocating is a good idea
and avoids any surprise... In this case, we're happilly confusing
kvm_kernel_irq_routing_entry and kvm_irq_routing_entry...

Fixes: 95b110ab9a ("KVM: arm/arm64: Enable irqchip routing")
Cc: stable@vger.kernel.org # 4.8
Reported-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
This commit is contained in:
Marc Zyngier 2017-11-16 17:58:15 +00:00 committed by Christoffer Dall
parent 285a90e36b
commit 150009e2c7
1 changed files with 1 additions and 2 deletions

View File

@ -112,8 +112,7 @@ int kvm_vgic_setup_default_irq_routing(struct kvm *kvm)
u32 nr = dist->nr_spis; u32 nr = dist->nr_spis;
int i, ret; int i, ret;
entries = kcalloc(nr, sizeof(struct kvm_kernel_irq_routing_entry), entries = kcalloc(nr, sizeof(*entries), GFP_KERNEL);
GFP_KERNEL);
if (!entries) if (!entries)
return -ENOMEM; return -ENOMEM;