KVM: MMU: remove unnecessary check
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Fri, 7 Sep 2012 06:15:03 +0000 (14:15 +0800)
committerAvi Kivity <avi@redhat.com>
Mon, 10 Sep 2012 08:26:16 +0000 (11:26 +0300)
Checking the return of kvm_mmu_get_page is unnecessary since it is
guaranteed by memory cache

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c

index 399c177..aa0b469 100644 (file)
@@ -2616,11 +2616,6 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
                        sp = kvm_mmu_get_page(vcpu, pseudo_gfn, iterator.addr,
                                              iterator.level - 1,
                                              1, ACC_ALL, iterator.sptep);
-                       if (!sp) {
-                               pgprintk("nonpaging_map: ENOMEM\n");
-                               kvm_release_pfn_clean(pfn);
-                               return -ENOMEM;
-                       }
 
                        mmu_spte_set(iterator.sptep,
                                     __pa(sp->spt)