diff options
author | Tiejun Chen <tiejun.chen@intel.com> | 2015-01-09 16:29:14 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-01-27 21:31:44 +0100 |
commit | b0165f1b415daeedab78455aaac529aaec6007dd (patch) | |
tree | 723f612cd129f74f402d38e8ba4ae5222d2f5836 | |
parent | 128ca093cc3cf3fc0368fa56b6a98f395090ddb0 (diff) | |
download | linux-stable-b0165f1b415daeedab78455aaac529aaec6007dd.tar.gz linux-stable-b0165f1b415daeedab78455aaac529aaec6007dd.tar.bz2 linux-stable-b0165f1b415daeedab78455aaac529aaec6007dd.zip |
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>
-rw-r--r-- | virt/kvm/kvm_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 246cf291c6fd..a8490f084483 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -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 { |