diff options
author | James Hogan <james.hogan@imgtec.com> | 2014-05-29 05:16:44 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-05-30 07:05:46 -0400 |
commit | c6c0a6637f9da54f9472144d44f71cf847f92e20 (patch) | |
tree | 8326b825442d603c7d1b6a4c4af3cb69f02f37e0 | |
parent | 6e95bfd2675ea5332b10e9414de8886243ca53ae (diff) |
MIPS: KVM: Remove redundant NULL checks before kfree()
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>
-rw-r--r-- | arch/mips/kvm/kvm_mips.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/mips/kvm/kvm_mips.c b/arch/mips/kvm/kvm_mips.c index dd7b115c26e8..eaa81aa15e02 100644 --- a/arch/mips/kvm/kvm_mips.c +++ b/arch/mips/kvm/kvm_mips.c | |||
@@ -144,9 +144,7 @@ void kvm_mips_free_vcpus(struct kvm *kvm) | |||
144 | if (kvm->arch.guest_pmap[i] != KVM_INVALID_PAGE) | 144 | if (kvm->arch.guest_pmap[i] != KVM_INVALID_PAGE) |
145 | kvm_mips_release_pfn_clean(kvm->arch.guest_pmap[i]); | 145 | kvm_mips_release_pfn_clean(kvm->arch.guest_pmap[i]); |
146 | } | 146 | } |
147 | 147 | kfree(kvm->arch.guest_pmap); | |
148 | if (kvm->arch.guest_pmap) | ||
149 | kfree(kvm->arch.guest_pmap); | ||
150 | 148 | ||
151 | kvm_for_each_vcpu(i, vcpu, kvm) { | 149 | kvm_for_each_vcpu(i, vcpu, kvm) { |
152 | kvm_arch_vcpu_free(vcpu); | 150 | kvm_arch_vcpu_free(vcpu); |
@@ -384,12 +382,8 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) | |||
384 | 382 | ||
385 | kvm_mips_dump_stats(vcpu); | 383 | kvm_mips_dump_stats(vcpu); |
386 | 384 | ||
387 | if (vcpu->arch.guest_ebase) | 385 | kfree(vcpu->arch.guest_ebase); |
388 | kfree(vcpu->arch.guest_ebase); | 386 | kfree(vcpu->arch.kseg0_commpage); |
389 | |||
390 | if (vcpu->arch.kseg0_commpage) | ||
391 | kfree(vcpu->arch.kseg0_commpage); | ||
392 | |||
393 | } | 387 | } |
394 | 388 | ||
395 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) | 389 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) |