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]
Message-ID: <5d8ccfd7-2487-49a7-afbf-1706c0fb43f5@suse.cz>
Date: Fri, 28 Feb 2025 17:39:22 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Yu-Chun Lin <eleanor15x@...il.com>, akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, jserv@...s.ncku.edu.tw,
 visitorckw@...il.com, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] mm/list_lru: Remove redundant NULL check before kfree()

On 2/28/25 15:18, Yu-Chun Lin wrote:
> The kernel's kfree() documentation states: "If @object is NULL, no
> operation is performed." Remove checking for NULL before calling kfree().
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502250720.9ueIb7Xh-lkp@intel.com/
> Signed-off-by: Yu-Chun Lin <eleanor15x@...il.com>

This is already in mm-unstable:
https://lore.kernel.org/all/20250227082223.1173847-1-jingxiangzeng.cas@gmail.com/

> ---
>  mm/list_lru.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/list_lru.c b/mm/list_lru.c
> index 7d69434c70e0..7c8fb17d9027 100644
> --- a/mm/list_lru.c
> +++ b/mm/list_lru.c
> @@ -548,8 +548,7 @@ int memcg_list_lru_alloc(struct mem_cgroup *memcg, struct list_lru *lru,
>  			}
>  			xas_unlock_irqrestore(&xas, flags);
>  		} while (xas_nomem(&xas, gfp));
> -		if (mlru)
> -			kfree(mlru);
> +		kfree(mlru);
>  	} while (pos != memcg && !css_is_dying(&pos->css));
>  
>  	return xas_error(&xas);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ