MIPS: KVM: Remove redundant NULL checks before kfree()
authorJames Hogan <james.hogan@imgtec.com>
Thu, 29 May 2014 09:16:44 +0000 (10:16 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 30 May 2014 11:05:46 +0000 (13:05 +0200)
The kfree() function already NULL checks the parameter so remove the
redundant NULL checks before kfree() calls in arch/mips/kvm/.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: kvm@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Sanjay Lal <sanjayl@kymasys.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/mips/kvm/kvm_mips.c

index dd7b115c26e8b09bf619f4fd479513ad9f597b37..eaa81aa15e0235264165b2f86bb69568ec412a49 100644 (file)
@@ -144,9 +144,7 @@ void kvm_mips_free_vcpus(struct kvm *kvm)
                if (kvm->arch.guest_pmap[i] != KVM_INVALID_PAGE)
                        kvm_mips_release_pfn_clean(kvm->arch.guest_pmap[i]);
        }
-
-       if (kvm->arch.guest_pmap)
-               kfree(kvm->arch.guest_pmap);
+       kfree(kvm->arch.guest_pmap);
 
        kvm_for_each_vcpu(i, vcpu, kvm) {
                kvm_arch_vcpu_free(vcpu);
@@ -384,12 +382,8 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
 
        kvm_mips_dump_stats(vcpu);
 
-       if (vcpu->arch.guest_ebase)
-               kfree(vcpu->arch.guest_ebase);
-
-       if (vcpu->arch.kseg0_commpage)
-               kfree(vcpu->arch.kseg0_commpage);
-
+       kfree(vcpu->arch.guest_ebase);
+       kfree(vcpu->arch.kseg0_commpage);
 }
 
 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
This page took 0.029975 seconds and 5 git commands to generate.