summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2017-10-26 17:23:04 +0200
committerChristoffer Dall <christoffer.dall@linaro.org>2017-10-29 03:25:06 +0100
commitf31b98b57f72dcd458eb63f795f4efe272acc2e3 (patch)
treee4917955dc35b0291272ba746aaa9c6fb14cc285 /virt
parentb92382620e33c9f1bcbcd7c169262b9bf0525871 (diff)
downloadlinux-f31b98b57f72dcd458eb63f795f4efe272acc2e3.tar.bz2
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: ea1ad53e1e31a3 (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>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index 76685f4c6261..6a715a6ec64e 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -2264,6 +2264,10 @@ static int vgic_its_restore_collection_table(struct vgic_its *its)
gpa += cte_esz;
read += cte_esz;
}
+
+ if (ret > 0)
+ return 0;
+
return ret;
}