lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220831145736.304864-1-cui.jinpeng2@zte.com.cn>
Date:   Wed, 31 Aug 2022 14:57:36 +0000
From:   cgel.zte@...il.com
To:     seanjc@...gle.com, pbonzini@...hat.com, tglx@...utronix.de
Cc:     mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
        x86@...nel.org, hpa@...or.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Jinpeng Cui <cui.jinpeng2@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] KVM: x86/mmu: remove redundant variable r

From: Jinpeng Cui <cui.jinpeng2@....com.cn>

Return value directly from kvm_mmu_unprotect_page()
instead of getting value from redundant variable r.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@....com.cn>
---
 arch/x86/kvm/mmu/mmu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index e418ef3ecfcb..23f1ab9e521f 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -2633,16 +2633,13 @@ int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn)
 static int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
 {
 	gpa_t gpa;
-	int r;
 
 	if (vcpu->arch.mmu->root_role.direct)
 		return 0;
 
 	gpa = kvm_mmu_gva_to_gpa_read(vcpu, gva, NULL);
 
-	r = kvm_mmu_unprotect_page(vcpu->kvm, gpa >> PAGE_SHIFT);
-
-	return r;
+	return kvm_mmu_unprotect_page(vcpu->kvm, gpa >> PAGE_SHIFT);
 }
 
 static void kvm_unsync_page(struct kvm *kvm, struct kvm_mmu_page *sp)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ