diff options
| author | Zenghui Yu <zenghui.yu@linux.dev> | 2025-10-08 18:45:20 +0300 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2025-10-13 16:27:55 +0300 |
| commit | 2192d348c0aa0cc2e7249dc3709f21bfe0a0170c (patch) | |
| tree | 6644de984b0c02a714a5fe75477707bb1a0f0ab2 /tools/testing | |
| parent | c35dd838666d47de2848639234ec32e3ba22b49f (diff) | |
| download | linux-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>
Diffstat (limited to 'tools/testing')
| -rw-r--r-- | tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c | 2 |
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); |
