arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 27 Feb 2015 11:41:45 +0000 (19:41 +0800)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 13 Mar 2015 10:40:57 +0000 (11:40 +0100)
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>
virt/kvm/arm/vgic.c

index 0cc6ab6005a07bb2e9453106a672e9efd4e237a6..4b2c2e7856a3c0ad7c8a47181375b1aa9d2960f5 100644 (file)
@@ -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