]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: kvm_binary_stats_test: Fix index expressions
authorAndrew Jones <drjones@redhat.com>
Tue, 14 Jun 2022 08:10:41 +0000 (10:10 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Jun 2022 16:43:53 +0000 (12:43 -0400)
commitb73e565ba362ddf6017307f64da6bd3c461c9d6f
tree3254268f719d3fb347036380c8e2d1c66a99b401
parent273627ccfb62897b02186ec7c4f2313ae24c4f41
KVM: selftests: kvm_binary_stats_test: Fix index expressions

kvm_binary_stats_test accepts two arguments, the number of vms
and number of vcpus. If these inputs are not equal then the
test would likely crash for one reason or another due to using
miscalculated indices for the vcpus array. Fix the index
expressions by swapping the use of i and j.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20220614081041.2571511-1-drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/kvm_binary_stats_test.c