]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: avoid uninitialized variable warning
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 6 Sep 2015 14:24:50 +0000 (16:24 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 6 Sep 2015 14:26:21 +0000 (16:26 +0200)
commit4231d81b0551f5f2cfc3d7383709a9701c0066cf
tree161bb65694da16145353ff44f7e08b16a2840847
parentd1747dcea278b83c33d0179e41ccd8493aa7ad2f
KVM: x86: avoid uninitialized variable warning

This does not show up on all compiler versions, so it sneaked into the
first 4.3 pull request.  The fix is to mimic the logic of the "print
sptes" loop in the "fill array" loop.  Then leaf and root can be
both initialized unconditionally.

Note that "leaf" now points to the first unused element of the array,
not the last filled element.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c