]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: arm64: vgic-v3: Fix error handling in vgic_v3_set_redist_base()
authorEric Auger <eric.auger@redhat.com>
Mon, 5 Apr 2021 16:39:35 +0000 (18:39 +0200)
committerMarc Zyngier <maz@kernel.org>
Tue, 6 Apr 2021 13:51:37 +0000 (14:51 +0100)
commit8542a8f95a67ff6b76d6868ec0af58c464bdf041
treecf338577a14383db55c55a209c80ff30b63eb92c
parent53b16dd6ba5cf64ed147ac3523ec34651d553cb0
KVM: arm64: vgic-v3: Fix error handling in vgic_v3_set_redist_base()

vgic_v3_insert_redist_region() may succeed while
vgic_register_all_redist_iodevs fails. For example this happens
while adding a redistributor region overlapping a dist region. The
failure only is detected on vgic_register_all_redist_iodevs when
vgic_v3_check_base() gets called in vgic_register_redist_iodev().

In such a case, remove the newly added redistributor region and free
it.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210405163941.510258-4-eric.auger@redhat.com
arch/arm64/kvm/vgic/vgic-mmio-v3.c