Message ID | 1509031391-4407-3-git-send-email-eric.auger@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Oct 26, 2017 at 05:23:04PM +0200, Eric Auger wrote: > 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. > Acked-by: Christoffer Dall <christoffer.dall@linaro.org> > Fixes: ea1ad53e1e31a3 (KVM: arm64: vgic-its: Collection table save/restore) > Signed-off-by: Eric Auger <eric.auger@redhat.com> > > --- > > v5 -> v6: > - use the same trick as vgic_its_restore_itt and > vgic_its_restore_device_tables > > v4 -> v5: > - added Christoffer R-b > > v2 -> v3: creation > --- > virt/kvm/arm/vgic/vgic-its.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c > index d27a301..8230ffe 100644 > --- a/virt/kvm/arm/vgic/vgic-its.c > +++ b/virt/kvm/arm/vgic/vgic-its.c > @@ -2268,6 +2268,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; > } > > -- > 2.5.5 >
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index d27a301..8230ffe 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -2268,6 +2268,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; }
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> --- v5 -> v6: - use the same trick as vgic_its_restore_itt and vgic_its_restore_device_tables v4 -> v5: - added Christoffer R-b v2 -> v3: creation --- virt/kvm/arm/vgic/vgic-its.c | 4 ++++ 1 file changed, 4 insertions(+)