On 17/11/14 09:27, wanghaibin wrote: > Add a out_unlock flag, for the different unusual can goto the > corresponding flag. > > Signed-off-by: wanghaibin <wanghaibin.wang@xxxxxxxxxx> > --- > virt/kvm/arm/vgic.c | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index bd4b104..d6a6c05 100644 > --- a/virt/kvm/arm/vgic.c > +++ b/virt/kvm/arm/vgic.c > @@ -1897,19 +1897,19 @@ int kvm_vgic_init(struct kvm *kvm) > mutex_lock(&kvm->lock); > > if (vgic_initialized(kvm)) > - goto out; > + goto out_unlock; > > if (IS_VGIC_ADDR_UNDEF(kvm->arch.vgic.vgic_dist_base) || > IS_VGIC_ADDR_UNDEF(kvm->arch.vgic.vgic_cpu_base)) { > kvm_err("Need to set vgic cpu and dist addresses first\n"); > ret = -ENXIO; > - goto out; > + goto out_unlock; > } > > ret = vgic_init_maps(kvm); > if (ret) { > kvm_err("Unable to allocate maps\n"); > - goto out; > + goto out_unlock; > } > > ret = kvm_phys_addr_ioremap(kvm, kvm->arch.vgic.vgic_cpu_base, > @@ -1927,6 +1927,8 @@ int kvm_vgic_init(struct kvm *kvm) > out: > if (ret) > kvm_vgic_destroy(kvm); > + > +out_unlock: > mutex_unlock(&kvm->lock); > return ret; > } > Sorry, but I really have to ask: What does this buy us? Please tell me, because I'm struggling to see how this patch optimizes anything moderately relevant. M. -- Jazz is not dead. It just smells funny... _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm