X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=virt%2Fkvm%2Firqchip.c;h=58e4f88b2b9fb4ecd0765f6e653f8dc14b5e0423;hb=8f4ae0f68c5cb796cda02b7d68b5b5c1ff6365b8;hp=2e6fc7c66a11311b02c8f7d034b636195e4acce3;hpb=d72619706abc4aa7e540ea882dae883cee7cc3b3;p=linux-2.6-microblaze.git diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index 2e6fc7c66a11..58e4f88b2b9f 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -184,9 +184,7 @@ int kvm_set_irq_routing(struct kvm *kvm, nr_rt_entries += 1; - new = kzalloc(sizeof(*new) + (nr_rt_entries * sizeof(struct hlist_head)), - GFP_KERNEL_ACCOUNT); - + new = kzalloc(struct_size(new, map, nr_rt_entries), GFP_KERNEL_ACCOUNT); if (!new) return -ENOMEM;