Skip to content

Commit f31b98b

Browse files
eaugerchazy
authored andcommitted
KVM: arm/arm64: vgic-its: Fix vgic_its_restore_collection_table returned value
vgic_its_restore_cte returns +1 if the collection table entry is valid and properly decoded. As a consequence, if the collection table is fully filled with valid data that are decoded without error, vgic_its_restore_collection_table() returns +1. This is wrong. Let's return 0 in that case. Fixes: ea1ad53 (KVM: arm64: vgic-its: Collection table save/restore) Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
1 parent b923826 commit f31b98b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,10 @@ static int vgic_its_restore_collection_table(struct vgic_its *its)
22642264
gpa += cte_esz;
22652265
read += cte_esz;
22662266
}
2267+
2268+
if (ret > 0)
2269+
return 0;
2270+
22672271
return ret;
22682272
}
22692273

0 commit comments

Comments
 (0)