summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZenghui Yu <zenghui.yu@linux.dev>2025-10-08 18:45:20 +0300
committerMarc Zyngier <maz@kernel.org>2025-10-13 16:27:55 +0300
commit2192d348c0aa0cc2e7249dc3709f21bfe0a0170c (patch)
tree6644de984b0c02a714a5fe75477707bb1a0f0ab2
parentc35dd838666d47de2848639234ec32e3ba22b49f (diff)
downloadlinux-2192d348c0aa0cc2e7249dc3709f21bfe0a0170c.tar.xz
KVM: arm64: selftests: Allocate vcpus with correct size
vcpus array contains pointers to struct kvm_vcpu {}. It is way overkill to allocate the array with (nr_cpus * sizeof(struct kvm_vcpu)). Fix the allocation by using the correct size. Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev> Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c b/tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c
index 87922a89b134..b134a304f0a6 100644
--- a/tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c
+++ b/tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c
@@ -331,7 +331,7 @@ static void setup_vm(void)
{
int i;
- vcpus = malloc(test_data.nr_cpus * sizeof(struct kvm_vcpu));
+ vcpus = malloc(test_data.nr_cpus * sizeof(struct kvm_vcpu *));
TEST_ASSERT(vcpus, "Failed to allocate vCPU array");
vm = vm_create_with_vcpus(test_data.nr_cpus, guest_code, vcpus);