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] [thread-next>] [day] [month] [year] [list]
Message-ID: <41628185-039e-6cb2-b615-dd5e8af338e7@suse.cz>
Date:   Wed, 17 Jun 2020 12:43:45 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Yi Wang <wang.yi59@....com.cn>, cl@...ux.com
Cc:     penberg@...nel.org, rientjes@...gle.com, iamjoonsoo.kim@....com,
        akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, xue.zhihong@....com.cn,
        wang.liang82@....com.cn, Liao Pingfang <liao.pingfang@....com.cn>
Subject: Re: [PATCH] mm, slab: Use kmem_cache_zalloc() instead of
 kmem_cache_alloc() with flag GFP_ZERO.

On 6/17/20 9:15 AM, Yi Wang wrote:
> From: Liao Pingfang <liao.pingfang@....com.cn>
> 
> Use kmem_cache_zalloc instead of manually calling kmem_cache_alloc
> with flag GFP_ZERO.
> 
> Signed-off-by: Liao Pingfang <liao.pingfang@....com.cn>
> ---
>  include/linux/slab.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index 6d45488..1fa62d9 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -656,7 +656,7 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long);
>   */
>  static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
>  {
> -	return kmem_cache_alloc(k, flags | __GFP_ZERO);
> +	return kmem_cache_zalloc(k, flags);

Did you test this patch?

>  }
>  
>  /**
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ