OSDN Git Service

KVM: arm64: Return error from kvm_arch_init_vm() on allocation failure
authorWill Deacon <will@kernel.org>
Thu, 9 Jun 2022 12:12:18 +0000 (13:12 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 9 Jun 2022 12:24:02 +0000 (13:24 +0100)
commitae187fec75aa670a551d9662f83e3947d3f02a69
tree599b756248e97d2c09541a87a8b78e71b811b5a8
parentefedd01de475e126e43a07d0b1221bb65e497163
KVM: arm64: Return error from kvm_arch_init_vm() on allocation failure

If we fail to allocate the 'supported_cpus' cpumask in kvm_arch_init_vm()
then be sure to return -ENOMEM instead of success (0) on the failure
path.

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220609121223.2551-2-will@kernel.org
arch/arm64/kvm/arm.c