aboutsummaryrefslogtreecommitdiffstats
path: root/.cocciconfig
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-01-09 14:58:55 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-27 19:59:59 +0100
commit6ad1e29fe0aba843dfffc714fced0ef6a2e19502 (patch)
tree5cad93a7b21f8e66ed2d6b219af16652fb565044 /.cocciconfig
parentKVM: Check for a bad hva before dropping into the ghc slow path (diff)
downloadlinux-dev-6ad1e29fe0aba843dfffc714fced0ef6a2e19502.tar.xz
linux-dev-6ad1e29fe0aba843dfffc714fced0ef6a2e19502.zip
KVM: Clean up __kvm_gfn_to_hva_cache_init() and its callers
Barret reported a (technically benign) bug where nr_pages_avail can be accessed without being initialized if gfn_to_hva_many() fails. virt/kvm/kvm_main.c:2193:13: warning: 'nr_pages_avail' may be used uninitialized in this function [-Wmaybe-uninitialized] Rather than simply squashing the warning by initializing nr_pages_avail, fix the underlying issues by reworking __kvm_gfn_to_hva_cache_init() to return immediately instead of continuing on. Now that all callers check the result and/or bail immediately on a bad hva, there's no need to explicitly nullify the memslot on error. Reported-by: Barret Rhoden <brho@google.com> Fixes: f1b9dd5eb86c ("kvm: Disallow wraparound in kvm_gfn_to_hva_cache_init") Cc: Jim Mattson <jmattson@google.com> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '.cocciconfig')
0 files changed, 0 insertions, 0 deletions