diff options
Diffstat (limited to 'drivers/kvm/mmu.c')
| -rw-r--r-- | drivers/kvm/mmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 5915d7a1c4f7..d4de988d1828 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
| @@ -838,11 +838,12 @@ static void mmu_free_roots(struct kvm_vcpu *vcpu) | |||
| 838 | int i; | 838 | int i; |
| 839 | struct kvm_mmu_page *page; | 839 | struct kvm_mmu_page *page; |
| 840 | 840 | ||
| 841 | if (!VALID_PAGE(vcpu->mmu.root_hpa)) | ||
| 842 | return; | ||
| 841 | #ifdef CONFIG_X86_64 | 843 | #ifdef CONFIG_X86_64 |
| 842 | if (vcpu->mmu.shadow_root_level == PT64_ROOT_LEVEL) { | 844 | if (vcpu->mmu.shadow_root_level == PT64_ROOT_LEVEL) { |
| 843 | hpa_t root = vcpu->mmu.root_hpa; | 845 | hpa_t root = vcpu->mmu.root_hpa; |
| 844 | 846 | ||
| 845 | ASSERT(VALID_PAGE(root)); | ||
| 846 | page = page_header(root); | 847 | page = page_header(root); |
| 847 | --page->root_count; | 848 | --page->root_count; |
| 848 | vcpu->mmu.root_hpa = INVALID_PAGE; | 849 | vcpu->mmu.root_hpa = INVALID_PAGE; |
| @@ -853,7 +854,6 @@ static void mmu_free_roots(struct kvm_vcpu *vcpu) | |||
| 853 | hpa_t root = vcpu->mmu.pae_root[i]; | 854 | hpa_t root = vcpu->mmu.pae_root[i]; |
| 854 | 855 | ||
| 855 | if (root) { | 856 | if (root) { |
| 856 | ASSERT(VALID_PAGE(root)); | ||
| 857 | root &= PT64_BASE_ADDR_MASK; | 857 | root &= PT64_BASE_ADDR_MASK; |
| 858 | page = page_header(root); | 858 | page = page_header(root); |
| 859 | --page->root_count; | 859 | --page->root_count; |
