From: Wei Yongjun Date: Fri, 27 Feb 2015 11:41:45 +0000 (+0800) Subject: arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create() X-Git-Tag: v4.14-rc1~5653^2~21^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b52104e509479c4709eb9d81642df77c5ef2716b;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Christoffer Dall --- diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 0cc6ab6..4b2c2e7 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