From: Tiejun Chen Date: Fri, 9 Jan 2015 08:29:14 +0000 (+0800) Subject: kvm: update_memslots: clean flags for invalid memslots X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b0165f1b415daeedab78455aaac529aaec6007dd;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Paolo Bonzini --- 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 {