lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 10 Oct 2017 10:40:31 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Tim Hansen <devtimhansen@...il.com>
Cc:     rkrcmar@...hat.com, tglx@...utronix.de, mingo@...hat.com,
        hpa@...or.com, x86@...nel.org, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, alexander.levin@....verizon.com
Subject: Re: [PATCH] arch/x86: remove redundant null checks before
 kmem_cache_destroy

On 08/10/2017 05:15, Tim Hansen wrote:
> 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@...il.com>
> ---
>  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)
> 

Queued, thanks.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ