From: Like Xu Date: Tue, 1 Mar 2022 12:49:41 +0000 (+0800) Subject: KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() X-Git-Tag: v5.16.13~1 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=81cb88b44e015941e058f0f1f73ef0697c88653e;p=wrapfs-4.14.y.git KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() commit c6c937d673aaa1d603f62f134e1ca9c173eeeed3 upstream. Just like on the optional mmu_alloc_direct_roots() path, once shadow path reaches "r = -EIO" somewhere, the caller needs to know the actual state in order to enter error handling and avoid something worse. Fixes: 4a38162ee9f1 ("KVM: MMU: load PDPTRs outside mmu_lock") Signed-off-by: Like Xu Reviewed-by: Sean Christopherson Message-Id: <20220301124941.48412-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 84e23b9864f4..d70eee9e6716 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -3573,7 +3573,7 @@ static int mmu_alloc_shadow_roots(struct kvm_vcpu *vcpu) out_unlock: write_unlock(&vcpu->kvm->mmu_lock); - return 0; + return r; } static int mmu_alloc_special_roots(struct kvm_vcpu *vcpu)