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 4D722ECAAD3 for ; Thu, 15 Sep 2022 07:42:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE82C6B0074; Thu, 15 Sep 2022 03:42:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B968E6B0075; Thu, 15 Sep 2022 03:42:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A85948D0001; Thu, 15 Sep 2022 03:42:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9AC026B0074 for ; Thu, 15 Sep 2022 03:42:31 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 751B540C4E for ; Thu, 15 Sep 2022 07:42:31 +0000 (UTC) X-FDA: 79913527302.19.588872E Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf11.hostedemail.com (Postfix) with ESMTP id 1C05540099 for ; Thu, 15 Sep 2022 07:42:30 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EE2985CED5; Thu, 15 Sep 2022 07:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1663227749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=46CZPwTI4AhhpjyH8QcwMuqcADSvBwoVR5QSnvV/X54=; b=WhHYNKGLv5zBKW5a9rH8TaIAsmmFi68O6H6iuMB2t4oCQ6BNZNXqykbqAtET2Q97c7rCxq pJlIlgJmBIxh05WmafILs8NxqbDtKPKMzzBdqrsk12LhyICjubo2leko6ECXP1MwkM+bu4 R8uBTgeVsFADu9I44MTxs9V58cNXRZ8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1663227749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=46CZPwTI4AhhpjyH8QcwMuqcADSvBwoVR5QSnvV/X54=; b=x0M9qQuX3ZB1GiEZ28bHTJzea0tXYA13/IxboTQn91tmOmHil0IKangfxRD5/j5WlmGI1t THMcxPTvvJGzp6CQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 98CDF133A7; Thu, 15 Sep 2022 07:42:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1xiCImXXImPuZwAAMHmgww (envelope-from ); Thu, 15 Sep 2022 07:42:29 +0000 Date: Thu, 15 Sep 2022 09:42:28 +0200 From: Oscar Salvador To: Miaohe Lin Cc: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 13/16] mm/page_alloc: init local variable buddy_pfn Message-ID: References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-14-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909092451.24883-14-linmiaohe@huawei.com> ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=WhHYNKGL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=x0M9qQuX; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf11.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663227751; a=rsa-sha256; cv=none; b=0QA8kNlzmT00N4ghzgMuhOxebCKml7kU+KYHoKLvZtJr0eujrMOutK4o3a9jMhlrT1bIVf Z3/GeIlE9T2qd/zJwQ0trf9XxsAx8w72WBTzD16I9pki4OGKE6NG0IfxjtWWWgr0TZNx6N KnezATTx8eXmCWLniFXWP36tNh0jYnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663227751; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=46CZPwTI4AhhpjyH8QcwMuqcADSvBwoVR5QSnvV/X54=; b=uHpc7i4B9C1V6wBn8y/5b5FzJX7kZhMPIgrGp7ZbDT91CN3brcc2rku9PpQ+YFV3D7t0OM /JkOYetQpHcLNvj05oZ2i1NZgDXYT7PlURF/7hNI3JT4b9hHLkR6WEgYe2k73EhFPHRSvl Ax5wnbX5P3VcqGnxiuoXJsUgwWnDvQo= Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=WhHYNKGL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=x0M9qQuX; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf11.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Rspam-User: X-Rspamd-Queue-Id: 1C05540099 X-Rspamd-Server: rspam01 X-Stat-Signature: oj4pxh4nezcrcj97suqkacsbtfm3isp7 X-HE-Tag: 1663227750-419398 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: On Fri, Sep 09, 2022 at 05:24:48PM +0800, Miaohe Lin wrote: > The local variable buddy_pfn could be passed to buddy_merge_likely() > without initialization if the passed in order is MAX_ORDER - 1. This > looks buggy but buddy_pfn won't be used in this case as there's a > order >= MAX_ORDER - 2 check. Init buddy_pfn to 0 anyway to avoid > possible future misuse. > > Signed-off-by: Miaohe Lin Reviewed-by: Oscar Salvador > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index e1c7f98cff96..63ad25e86010 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1113,7 +1113,7 @@ static inline void __free_one_page(struct page *page, > int migratetype, fpi_t fpi_flags) > { > struct capture_control *capc = task_capc(zone); > - unsigned long buddy_pfn; > + unsigned long buddy_pfn = 0; > unsigned long combined_pfn; > struct page *buddy; > bool to_tail; > -- > 2.23.0 > -- Oscar Salvador SUSE Labs