Commit a05d1c0d authored by Marc Zyngier's avatar Marc Zyngier Committed by Christoffer Dall

KVM: arm/arm64: vgic-v4: Only perform an unmap for valid vLPIs

Before performing an unmap, let's check that what we have was
really mapped the first place.
Reviewed-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
parent 686f294f
...@@ -337,8 +337,10 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int virq, ...@@ -337,8 +337,10 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int virq,
goto out; goto out;
WARN_ON(!(irq->hw && irq->host_irq == virq)); WARN_ON(!(irq->hw && irq->host_irq == virq));
irq->hw = false; if (irq->hw) {
ret = its_unmap_vlpi(virq); irq->hw = false;
ret = its_unmap_vlpi(virq);
}
out: out:
mutex_unlock(&its->its_lock); mutex_unlock(&its->its_lock);
......
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