kvm: update_memslots: clean flags for invalid memslots
Indeed, any invalid memslots should be new->npages = 0, new->base_gfn = 0 and new->flags = 0 at the same time. Signed-off-by: Tiejun Chen <tiejun.chen@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
128ca093cc
commit
b0165f1b41
1 changed files with 1 additions and 0 deletions
|
@ -675,6 +675,7 @@ static void update_memslots(struct kvm_memslots *slots,
|
|||
if (!new->npages) {
|
||||
WARN_ON(!mslots[i].npages);
|
||||
new->base_gfn = 0;
|
||||
new->flags = 0;
|
||||
if (mslots[i].npages)
|
||||
slots->used_slots--;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue