mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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>
This commit is contained in:
parent
c35dd83866
commit
2192d348c0
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user