From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A5ADC282C1 for ; Fri, 28 Feb 2025 16:39:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0DB3F280005; Fri, 28 Feb 2025 11:39:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 063A3280003; Fri, 28 Feb 2025 11:39:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1F71280005; Fri, 28 Feb 2025 11:39:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C20CB280003 for ; Fri, 28 Feb 2025 11:39:26 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 700A6B185B for ; Fri, 28 Feb 2025 16:39:26 +0000 (UTC) X-FDA: 83169913932.08.6B95ABC Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf26.hostedemail.com (Postfix) with ESMTP id 28130140008 for ; Fri, 28 Feb 2025 16:39:23 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cXz8Duyz; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="tU/xh/FV"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cXz8Duyz; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="tU/xh/FV"; spf=pass (imf26.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740760764; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=o2Z/+S0bCpIiR/CVWr/u3iutpDVKtDE6whnqXRO+9u8=; b=hpf1lpRWqFVPnQFc19ZppXqmOgFMduHU5/3yWaBra9VWf/TdM2zbJZxVnXe+PWo4RWD0C1 83L3SBNc1X+n9kg6bL0qgJJIatRio5BhM5PX3jIhv4kWIVRIMDZP/UTYUlRgNlByDUNbGx FJq3zW39Uc8VG5AMlJJmXN49RsF+fTc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740760764; a=rsa-sha256; cv=none; b=e6Or3QqWvGtowA6y/hSYP8zvm35dMN/6YOELJCUyx913uTlbsvKWWIl9TreiK79r5Ft5YT Md48UgOj0+dtNRDDasX7DpDB2jZd71wMkE6W0TX9cDnADRQ9DpOCyghMvWu1oQeQnd3001 eM6ZaF6YSCY4dVlV7BLioJJiZwOCi64= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cXz8Duyz; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="tU/xh/FV"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cXz8Duyz; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="tU/xh/FV"; spf=pass (imf26.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A61F72119E; Fri, 28 Feb 2025 16:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740760762; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o2Z/+S0bCpIiR/CVWr/u3iutpDVKtDE6whnqXRO+9u8=; b=cXz8DuyzO3RX8yrluy8Jk489nDWdrLlrqszF2Up5KEEVGmL1saU9abNYyN53qFHlPkewuP RgYVHta9FQ6W2Zba8oMS2yrwFp5yhYn+vDCA/E8v5oUPKDWb4XJQMbBIDWvPJG3VVOVDVJ Ym9AVjIGTE6hm8gBa5EwRA3adj2DjCs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740760762; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o2Z/+S0bCpIiR/CVWr/u3iutpDVKtDE6whnqXRO+9u8=; b=tU/xh/FVayA97vO9aBwbHWWtvr39v4qJc89EceUl7pyBmTxdGLlnPCVGdoeAAf1wE6J0nm U9wU2uzkOv07XtBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740760762; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o2Z/+S0bCpIiR/CVWr/u3iutpDVKtDE6whnqXRO+9u8=; b=cXz8DuyzO3RX8yrluy8Jk489nDWdrLlrqszF2Up5KEEVGmL1saU9abNYyN53qFHlPkewuP RgYVHta9FQ6W2Zba8oMS2yrwFp5yhYn+vDCA/E8v5oUPKDWb4XJQMbBIDWvPJG3VVOVDVJ Ym9AVjIGTE6hm8gBa5EwRA3adj2DjCs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740760762; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o2Z/+S0bCpIiR/CVWr/u3iutpDVKtDE6whnqXRO+9u8=; b=tU/xh/FVayA97vO9aBwbHWWtvr39v4qJc89EceUl7pyBmTxdGLlnPCVGdoeAAf1wE6J0nm U9wU2uzkOv07XtBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 943C4137AC; Fri, 28 Feb 2025 16:39:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mIN5IrrmwWcKYwAAD6G6ig (envelope-from ); Fri, 28 Feb 2025 16:39:22 +0000 Message-ID: <5d8ccfd7-2487-49a7-afbf-1706c0fb43f5@suse.cz> Date: Fri, 28 Feb 2025 17:39:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/list_lru: Remove redundant NULL check before kfree() Content-Language: en-US To: Yu-Chun Lin , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jserv@ccns.ncku.edu.tw, visitorckw@gmail.com, kernel test robot References: <20250228141856.730825-1-eleanor15x@gmail.com> From: Vlastimil Babka In-Reply-To: <20250228141856.730825-1-eleanor15x@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: mawagdfnxrd5mixn5eurwqabiruf9z43 X-Rspamd-Queue-Id: 28130140008 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1740760763-929951 X-HE-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2P7L4Oi/3sLppgduMYSm4J5ZvbXmtFEWEbXI0KcXxviaFQsZKf9I0lkZfrwJqOEuQClwnxM2J/GS5FWuzZba4eVzIL/fFMWrI5kn2YTgGoWZhaMNcmfAbIJ3ZA1HnR4o95lNFnTRT64RoC1XaskRyK5l7dJkssPkWxUYI1HbRY6aVhxE2GT83AsTB+w/mr3jFCHZvpInaIMFt563PPEv3BBXV7zcq+BYyCpVKKAXtUgcVlChtGRpfLI/B9n8salSBLv3yvA4l/JMB6E6jtVXS0p8LVDcQhoNQIk2lpvcotLaAxd6CEulyK9aSGPA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 > Closes: https://lore.kernel.org/oe-kbuild-all/202502250720.9ueIb7Xh-lkp@intel.com/ > Signed-off-by: Yu-Chun Lin 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);