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: <56ee5ac0-0785-cf2a-c1b4-95d4df2d11f1@iki.fi>
Date:   Sat, 29 Dec 2018 12:02:14 +0200
From:   Pekka Enberg <penberg@....fi>
To:     Peng Wang <rocking@....edu.cn>, cl@...ux.com, penberg@...nel.org,
        rientjes@...gle.com, iamjoonsoo.kim@....com,
        akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/slub.c: freelist is ensured to be NULL when new_slab()
 fails

On 29/12/2018 8.25, Peng Wang wrote:
> new_slab_objects() will return immediately if freelist is not NULL.
> 
>           if (freelist)
>                   return freelist;
> 
> One more assignment operation could be avoided.
> 
> Signed-off-by: Peng Wang <rocking@....edu.cn>

Reviewed-by: Pekka Enberg <penberg@...nel.org>

> ---
>   mm/slub.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 36c0befeebd8..cf2ef4ababff 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2463,8 +2463,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
>   		stat(s, ALLOC_SLAB);
>   		c->page = page;
>   		*pc = c;
> -	} else
> -		freelist = NULL;
> +	}
>   
>   	return freelist;
>   }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ