Skip to content

Commit

Permalink
arm/arm64: KVM: fix missing unlock on error in kvm_vgic_create()
Browse files Browse the repository at this point in the history
Add the missing unlock before return from function kvm_vgic_create()
in the error handling case.

Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Christoffer Dall <[email protected]>
  • Loading branch information
Wei Yongjun authored and chazy committed Mar 13, 2015
1 parent 84ed741 commit b52104e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions virt/kvm/arm/vgic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b52104e

Please sign in to comment.