Skip to content

Commit 8dbccaf

Browse files
author
Marc Zyngier
committed
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Reviewed-by: Quentin Perret <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent eabc7aa commit 8dbccaf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/arm64/kvm/hyp/nvhe/mem_protect.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,6 @@ int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hyp_vcpu *vcpu)
10731073
{
10741074
struct pkvm_hyp_vm *vm = pkvm_hyp_vcpu_to_hyp_vm(vcpu);
10751075
u64 ipa = hyp_pfn_to_phys(gfn);
1076-
int ret;
10771076

10781077
if (pkvm_hyp_vm_is_protected(vm))
10791078
return -EPERM;
@@ -1083,5 +1082,5 @@ int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hyp_vcpu *vcpu)
10831082
kvm_pgtable_stage2_mkyoung(&vm->pgt, ipa, 0);
10841083
guest_unlock_component(vm);
10851084

1086-
return ret;
1085+
return 0;
10871086
}

0 commit comments

Comments
 (0)