]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - virt/kvm/arm/vgic/vgic-init.c
Merge tag 'xfs-4.12-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[karo-tx-linux.git] / virt / kvm / arm / vgic / vgic-init.c
index dc68e2e424abf301151f4a610d412ea4b9109831..3a0b8999f011c6e3e1ff6ea7699577879a651fd3 100644 (file)
@@ -242,8 +242,11 @@ int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
         * If we are creating a VCPU with a GICv3 we must also register the
         * KVM io device for the redistributor that belongs to this VCPU.
         */
-       if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)
+       if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
+               mutex_lock(&vcpu->kvm->lock);
                ret = vgic_register_redist_iodev(vcpu);
+               mutex_unlock(&vcpu->kvm->lock);
+       }
        return ret;
 }