diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-20 13:00:08 +0300 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2017-04-20 04:37:50 +0300 |
commit | a1c52e1c7cb9fb8714b89b7bb5773c498e39e38b (patch) | |
tree | de5b5edd102109865ccc2b0d75cbb877245e450f /arch/powerpc/kvm | |
parent | 9b5ab0051306033b0b1e83dd72e1f84a0c8dd4bf (diff) | |
download | linux-a1c52e1c7cb9fb8714b89b7bb5773c498e39e38b.tar.xz |
KVM: PPC: Book3S HV: Use common error handling code in kvmppc_clr_passthru_irq()
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 1ec86d9e2a82..06b7d8ae27e5 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -3624,11 +3624,9 @@ static int kvmppc_clr_passthru_irq(struct kvm *kvm, int host_irq, int guest_gsi) return -EIO; mutex_lock(&kvm->lock); + if (!kvm->arch.pimap) + goto unlock; - if (kvm->arch.pimap == NULL) { - mutex_unlock(&kvm->lock); - return 0; - } pimap = kvm->arch.pimap; for (i = 0; i < pimap->n_mapped; i++) { @@ -3650,7 +3648,7 @@ static int kvmppc_clr_passthru_irq(struct kvm *kvm, int host_irq, int guest_gsi) * We don't free this structure even when the count goes to * zero. The structure is freed when we destroy the VM. */ - + unlock: mutex_unlock(&kvm->lock); return 0; } |