Skip to content

Commit 821c10c

Browse files
Zenghui YuMarc Zyngier
authored andcommitted
KVM: arm/arm64: vgic-its: Properly check the unmapped coll in DISCARD handler
Discard is supposed to fail if the collection is not mapped to any target redistributor. We currently check if the collection is mapped by "ite->collection" but this is incomplete (e.g., mapping a LPI to an unmapped collection also results in a non NULL ite->collection). What actually needs to be checked is its_is_collection_mapped(), let's turn to it. Also take this chance to remove an extra blank line. Signed-off-by: Zenghui Yu <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Eric Auger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1cfbb48 commit 821c10c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

virt/kvm/arm/vgic/vgic-its.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,8 @@ static int vgic_its_cmd_handle_discard(struct kvm *kvm, struct vgic_its *its,
839839
u32 event_id = its_cmd_get_id(its_cmd);
840840
struct its_ite *ite;
841841

842-
843842
ite = find_ite(its, device_id, event_id);
844-
if (ite && ite->collection) {
843+
if (ite && its_is_collection_mapped(ite->collection)) {
845844
/*
846845
* Though the spec talks about removing the pending state, we
847846
* don't bother here since we clear the ITTE anyway and the

0 commit comments

Comments
 (0)