Commit a1c52e1c authored by Markus Elfring's avatar Markus Elfring Committed by Paul Mackerras

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
parent 9b5ab005
...@@ -3624,11 +3624,9 @@ static int kvmppc_clr_passthru_irq(struct kvm *kvm, int host_irq, int guest_gsi) ...@@ -3624,11 +3624,9 @@ static int kvmppc_clr_passthru_irq(struct kvm *kvm, int host_irq, int guest_gsi)
return -EIO; return -EIO;
mutex_lock(&kvm->lock); 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; pimap = kvm->arch.pimap;
for (i = 0; i < pimap->n_mapped; i++) { 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) ...@@ -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 * We don't free this structure even when the count goes to
* zero. The structure is freed when we destroy the VM. * zero. The structure is freed when we destroy the VM.
*/ */
unlock:
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment