May be in some cases paging64_fetch() and paging32_fetch() will return sptep
without initialization.
Also fixes compilation warning:
CC arch/x86/kernel/io_delay.o
arch/x86/kvm/paging_tmpl.h: In function âpaging64_fetchâ:
arch/x86/kvm/paging_tmpl.h:279: warning: âsptepâ may be used uninitialized in this function
arch/x86/kvm/paging_tmpl.h: In function âpaging32_fetchâ:
arch/x86/kvm/paging_tmpl.h:279: warning: âsptepâ may be used uninitialized in this function
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@xxxxxxxxx>
---
arch/x86/kvm/paging_tmpl.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 6bd7020..99cb10d 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -276,7 +276,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
{
unsigned access = gw->pt_access;
struct kvm_mmu_page *shadow_page;
- u64 spte, *sptep;
+ u64 spte, *sptep = NULL;
int direct;
gfn_t table_gfn;
int r;