Skip to content

Commit

Permalink
kvm: update_memslots: clean flags for invalid memslots
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tiejun Chen authored and Paolo Bonzini committed Jan 27, 2015
1 parent 128ca09 commit b0165f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit b0165f1

Please sign in to comment.