]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: nVMX: kmap() can't fail
authorDavid Hildenbrand <david@redhat.com>
Wed, 25 Jan 2017 10:58:57 +0000 (11:58 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Feb 2017 17:16:44 +0000 (18:16 +0100)
kmap() can't fail, therefore it will always return a valid pointer. Let's
just get rid of the unnecessary checks.

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c

index d850d5d36182477db64deedcdebc7a2ce2acf3be..693e4203b666592a122c682ffa771792de77859d 100644 (file)
@@ -4973,10 +4973,6 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
                        return 0;
 
                vapic_page = kmap(vmx->nested.virtual_apic_page);
-               if (!vapic_page) {
-                       WARN_ON(1);
-                       return -ENOMEM;
-               }
                __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page);
                kunmap(vmx->nested.virtual_apic_page);
 
@@ -9738,11 +9734,6 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu,
                return false;
        }
        msr_bitmap_l1 = (unsigned long *)kmap(page);
-       if (!msr_bitmap_l1) {
-               nested_release_page_clean(page);
-               WARN_ON(1);
-               return false;
-       }
 
        memset(msr_bitmap_l0, 0xff, PAGE_SIZE);