KVM: explicitly set rmap_head->val to 0 in pte_list_desc_remove_entry()
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 5 Dec 2019 03:40:16 +0000 (11:40 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jan 2020 16:33:13 +0000 (17:33 +0100)
When we reach here, we have desc->sptes[j] = NULL with j = 0.
So we can replace desc->sptes[0] with 0 to make it more clear.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c

index 1e4ee4f8de5f0dfcac982f575095675d8678631b..35d37099bec6675f66010069838b1e4eeaecadc3 100644 (file)
@@ -1414,7 +1414,7 @@ pte_list_desc_remove_entry(struct kvm_rmap_head *rmap_head,
        if (j != 0)
                return;
        if (!prev_desc && !desc->more)
-               rmap_head->val = (unsigned long)desc->sptes[0];
+               rmap_head->val = 0;
        else
                if (prev_desc)
                        prev_desc->more = desc->more;