Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Zenghui Yu and committed by
Marc Zyngier
2192d348 c35dd838

+1 -1
+1 -1
tools/testing/selftests/kvm/arm64/vgic_lpi_stress.c
··· 331 331 { 332 332 int i; 333 333 334 - vcpus = malloc(test_data.nr_cpus * sizeof(struct kvm_vcpu)); 334 + vcpus = malloc(test_data.nr_cpus * sizeof(struct kvm_vcpu *)); 335 335 TEST_ASSERT(vcpus, "Failed to allocate vCPU array"); 336 336 337 337 vm = vm_create_with_vcpus(test_data.nr_cpus, guest_code, vcpus);