@@ -285,11 +285,9 @@ int vgic_init(struct kvm *kvm)
if (ret)
goto out;
- if (vgic_supports_direct_msis(kvm)) {
- ret = vgic_v4_init(kvm);
- if (ret)
- goto out;
- }
+ ret = vgic_v4_init(kvm);
+ if (ret)
+ goto out;
kvm_for_each_vcpu(i, vcpu, kvm)
kvm_vgic_vcpu_enable(vcpu);
@@ -1673,7 +1673,7 @@ static int vgic_its_create(struct kvm_device *dev, u32 type)
if (vgic_initialized(dev->kvm)) {
int ret = vgic_v4_init(dev->kvm);
- if (ret) {
+ if (ret < 0) {
kfree(its);
return ret;
}
@@ -118,6 +118,9 @@ int vgic_v4_init(struct kvm *kvm)
struct kvm_vcpu *vcpu;
int i, nr_vcpus, ret;
+ if (!vgic_supports_direct_msis(kvm))
+ return 0; /* Nothing to see here... move along. */
+
if (dist->its_vm.vpes)
return 0;