]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arch/x86: remove redundant null checks before kmem_cache_destroy
authorTim Hansen <devtimhansen@gmail.com>
Sun, 8 Oct 2017 03:15:23 +0000 (23:15 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Oct 2017 12:01:54 +0000 (14:01 +0200)
Remove redundant null checks before calling kmem_cache_destroy.

Found with make coccicheck M=arch/x86/kvm on linux-next tag
next-20170929.

Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c

index cdedf5320145890111cc8d530a4c628fae07ca52..d7a7eafc5ade2b23c4273a2f7d3c76d9fb4d0e34 100644 (file)
@@ -5463,10 +5463,8 @@ static struct shrinker mmu_shrinker = {
 
 static void mmu_destroy_caches(void)
 {
-       if (pte_list_desc_cache)
-               kmem_cache_destroy(pte_list_desc_cache);
-       if (mmu_page_header_cache)
-               kmem_cache_destroy(mmu_page_header_cache);
+       kmem_cache_destroy(pte_list_desc_cache);
+       kmem_cache_destroy(mmu_page_header_cache);
 }
 
 int kvm_mmu_module_init(void)