]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Fix uninitialized boolean variable flush
authorColin Ian King <colin.king@canonical.com>
Tue, 22 Jun 2021 15:09:12 +0000 (16:09 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 08:31:16 +0000 (04:31 -0400)
commitbecb7ce5a92cb08894bfad027002a05d9916b897
treeff0308af6fe3463aae89bbf65188f6062a0374dd
parent7781f7a7a01fe3f7627556b5aa1045c2e3d3797b
KVM: x86/mmu: Fix uninitialized boolean variable flush

In the case where kvm_memslots_have_rmaps(kvm) is false the boolean
variable flush is not set and is uninitialized.  If is_tdp_mmu_enabled(kvm)
is true then the call to kvm_tdp_mmu_zap_collapsible_sptes passes the
uninitialized value of flush into the call. Fix this by initializing
flush to false.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 08763ffdb3a2 ("KVM: x86/mmu: Skip rmap operations if rmaps not allocated")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622150912.23429-1-colin.king@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c