From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753336AbdJHDPc (ORCPT ); Sat, 7 Oct 2017 23:15:32 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:52444 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbdJHDPa (ORCPT ); Sat, 7 Oct 2017 23:15:30 -0400 X-Google-Smtp-Source: AOwi7QAWjtyWVeVhiQutHl0z2lvISteW7XpfzHuN0DbIdj7hwDwg8fKe5bcIyv2Su4o5Hmua3PSBIQ== Date: Sat, 7 Oct 2017 23:15:23 -0400 From: Tim Hansen To: pbonzini@redhat.com Cc: rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, alexander.levin@one.verizon.com, devtimhansen@gmail.com Subject: [PATCH] arch/x86: remove redundant null checks before kmem_cache_destroy Message-ID: <20171008031523.jj63si46bgb27yxu@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/kvm/mmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index eca30c1eb1d9..a6c7177326c5 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -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) -- 2.14.2