diff options
author | 2015-02-27 19:41:45 +0800 | |
---|---|---|
committer | 2015-03-13 11:40:57 +0100 | |
commit | b52104e509479c4709eb9d81642df77c5ef2716b (patch) | |
tree | 0a32fae858b6efdd862e4ae2ae722402d73f9933 /virt/kvm/arm/vgic.c | |
parent | arm64: KVM: Fix outdated comment about VTCR_EL2.PS (diff) | |
download | linux-b52104e509479c4709eb9d81642df77c5ef2716b.tar.gz linux-b52104e509479c4709eb9d81642df77c5ef2716b.tar.bz2 linux-b52104e509479c4709eb9d81642df77c5ef2716b.zip |
arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create()
Add the missing unlock before return from function kvm_vgic_create()
in the error handling case.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt/kvm/arm/vgic.c')
-rw-r--r-- | virt/kvm/arm/vgic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 0cc6ab6005a0..4b2c2e7856a3 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1583,8 +1583,10 @@ int kvm_vgic_create(struct kvm *kvm, u32 type) * emulation. So check this here again. KVM_CREATE_DEVICE does * the proper checks already. */ - if (type == KVM_DEV_TYPE_ARM_VGIC_V2 && !vgic->can_emulate_gicv2) - return -ENODEV; + if (type == KVM_DEV_TYPE_ARM_VGIC_V2 && !vgic->can_emulate_gicv2) { + ret = -ENODEV; + goto out; + } /* * Any time a vcpu is run, vcpu_load is called which tries to grab the |