aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2025-02-10 09:17:58 +0000
committerMarc Zyngier <maz@kernel.org>2025-02-10 09:58:16 +0000
commit8dbccafce3c8ae026606f5c7bc6637667d9d5595 (patch)
treef5af970c5dffe9100f04d111a30d90bfc55c011a
parentKVM: arm64: Simplify np-guest hypercalls (diff)
downloadwireguard-linux-8dbccafce3c8ae026606f5c7bc6637667d9d5595.tar.xz
wireguard-linux-8dbccafce3c8ae026606f5c7bc6637667d9d5595.zip
KVM: arm64: Fix __pkvm_host_mkyoung_guest() return value
Don't use an uninitialised stack variable, and just return 0 on the non-error path. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202502100911.8c9DbtKD-lkp@intel.com/ Reviewed-by: Quentin Perret <qperret@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to '')
-rw-r--r--arch/arm64/kvm/hyp/nvhe/mem_protect.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c
index 4c2f6a6a2efe..19c3c631708c 100644
--- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c
+++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c
@@ -1073,7 +1073,6 @@ int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hyp_vcpu *vcpu)
{
struct pkvm_hyp_vm *vm = pkvm_hyp_vcpu_to_hyp_vm(vcpu);
u64 ipa = hyp_pfn_to_phys(gfn);
- int ret;
if (pkvm_hyp_vm_is_protected(vm))
return -EPERM;
@@ -1083,5 +1082,5 @@ int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hyp_vcpu *vcpu)
kvm_pgtable_stage2_mkyoung(&vm->pgt, ipa, 0);
guest_unlock_component(vm);
- return ret;
+ return 0;
}