@@ -502,7 +502,8 @@ static void its_free_itte(struct kvm *kvm, struct its_itte *itte)
list_del(&itte->itte_list);
/* This put matches the get in vgic_add_lpi. */
- vgic_put_irq(kvm, itte->irq);
+ if (iite->irq)
+ vgic_put_irq(kvm, itte->irq);
kfree(itte);
}
But this makes me wonder how we're really dealing with reference counts
in the case where you find an itte and don't need to allocate one.
Would this BUG_ON ever fire?:
@@ -730,6 +730,8 @@ static int vgic_its_cmd_handle_mapi(struct kvm *kvm, struct vgic_its *its,
itte->event_id = event_id;
list_add_tail(&itte->itte_list, &device->itt_head);
+ } else {
+ BUG_ON(itte->irq);
}
itte->collection = collection;