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]
Date:   Sat, 8 Oct 2022 20:21:21 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     XU pengfei <xupengfei@...china.com>
CC:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/1] mm/mmap_lock: Remove unnecessary 'NULL' values from
 Pointer

On 2022/10/8 17:39, XU pengfei wrote:
> Pointer variables allocate memory first, and then judge. There is no
> need to initialize the assignment.
> 
> Signed-off-by: XU pengfei <xupengfei@...china.com>
> ---
>  mm/mmap_lock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/mmap_lock.c b/mm/mmap_lock.c
> index 1854850b4b89..65a57731aa15 100644
> --- a/mm/mmap_lock.c
> +++ b/mm/mmap_lock.c
> @@ -198,7 +198,7 @@ void trace_mmap_lock_unreg(void)
>   */
>  static const char *get_mm_memcg_path(struct mm_struct *mm)
>  {
> -	char *buf = NULL;
> +	char *buf;
>  	struct mem_cgroup *memcg = get_mem_cgroup_from_mm(mm);
>  
>  	if (memcg == NULL)

It seems if memcg == NULL, the code will go to out and return uninitialized @buf?

Thanks,
Miaohe Lin




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ