aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--virt/kvm/arm/vgic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 3aaca49de325..aacdb59f30de 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -1933,7 +1933,7 @@ out:
1933 1933
1934int kvm_vgic_create(struct kvm *kvm) 1934int kvm_vgic_create(struct kvm *kvm)
1935{ 1935{
1936 int i, vcpu_lock_idx = -1, ret = 0; 1936 int i, vcpu_lock_idx = -1, ret;
1937 struct kvm_vcpu *vcpu; 1937 struct kvm_vcpu *vcpu;
1938 1938
1939 mutex_lock(&kvm->lock); 1939 mutex_lock(&kvm->lock);
@@ -1948,6 +1948,7 @@ int kvm_vgic_create(struct kvm *kvm)
1948 * vcpu->mutex. By grabbing the vcpu->mutex of all VCPUs we ensure 1948 * vcpu->mutex. By grabbing the vcpu->mutex of all VCPUs we ensure
1949 * that no other VCPUs are run while we create the vgic. 1949 * that no other VCPUs are run while we create the vgic.
1950 */ 1950 */
1951 ret = -EBUSY;
1951 kvm_for_each_vcpu(i, vcpu, kvm) { 1952 kvm_for_each_vcpu(i, vcpu, kvm) {
1952 if (!mutex_trylock(&vcpu->mutex)) 1953 if (!mutex_trylock(&vcpu->mutex))
1953 goto out_unlock; 1954 goto out_unlock;
@@ -1955,11 +1956,10 @@ int kvm_vgic_create(struct kvm *kvm)
1955 } 1956 }
1956 1957
1957 kvm_for_each_vcpu(i, vcpu, kvm) { 1958 kvm_for_each_vcpu(i, vcpu, kvm) {
1958 if (vcpu->arch.has_run_once) { 1959 if (vcpu->arch.has_run_once)
1959 ret = -EBUSY;
1960 goto out_unlock; 1960 goto out_unlock;
1961 }
1962 } 1961 }
1962 ret = 0;
1963 1963
1964 spin_lock_init(&kvm->arch.vgic.lock); 1964 spin_lock_init(&kvm->arch.vgic.lock);
1965 kvm->arch.vgic.in_kernel = true; 1965 kvm->arch.vgic.in_kernel = true;