Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6340514rwn; Tue, 13 Sep 2022 02:48:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7cJlyBi5EPZhJBeTdWVuP6Fo7zTj981G9LrRvoRdHu0wzTMgZg/Hk6G/ldH9bX7RqI4aNE X-Received: by 2002:a05:6402:3904:b0:451:f01c:9217 with SMTP id fe4-20020a056402390400b00451f01c9217mr5541602edb.78.1663062484133; Tue, 13 Sep 2022 02:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663062484; cv=none; d=google.com; s=arc-20160816; b=hA6o588Zm2TvCRzdxbrWHFjgurLs8igUwGc/aHLo1iF+/yRBuenrg9K9Zze+Cslxqv I2eQ6MUQg+ZJZQJO1dNFSZhPphCBtV4prpO9LKiTyRNYFHI9ZmrCZLz8TJE+VQuq2kmh mN2XWmfKFx8kvHaSrzPTEwPQqSwxmTOUfhl28aYuMnsLPW0gU6FpUQYOvcLTrqZmzP3k JB0/iqDJuKQ3JtkBazD27mqPOsDP/QvcJFuq3Wft5j1TAdp5+TeziJsK41VWajt/VSim N4j4wMjmDy7uZnSAEdy1hgnE3MAoLVQrtp+n/thIZynorshLS3TfpcTYPpTF2Y/FnDOr sKRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ja3u+bLHOS3FpPFhV9WxSa9TzugOg5/AoXK7XHGfugM=; b=RbMS15cxbo5hnlrQF/Hcc1O0xCyfReU1DcvCG5Sl7wzBCY48h4nfQAkSv0ENgZiR8e XEZwmYCP/wBXxG9a81H09NOJyAbziH0fcSqPEnmbk+DJlEpZxfQXk0TMFZ77pgTcsoJr zmT3/WCkakdxQCLSkxy9lbnWsQ7ncJhMkBHQzEfO5eNliDc9B2XgQAHroIXdjxqfcOUW jGfnB7Fr/PWsIbIuvT7v4oPH1R+y+hiT0H2CnfcJOuLe/8pIlET/JPOLFc3I3gOXUQhx RvMmnvCg1EAhBMN+70CRYifjYjFb3+7nZ7pDpoKlRNRhcs4f2fsr0wr//TKMtthxHDRI sCMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ek20-20020a056402371400b0044884549409si8090174edb.356.2022.09.13.02.47.39; Tue, 13 Sep 2022 02:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbiIMJGY (ORCPT + 99 others); Tue, 13 Sep 2022 05:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbiIMJGT (ORCPT ); Tue, 13 Sep 2022 05:06:19 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C9451093 for ; Tue, 13 Sep 2022 02:06:19 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1E1D01063; Tue, 13 Sep 2022 02:06:25 -0700 (PDT) Received: from [10.162.42.9] (unknown [10.162.42.9]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 57AFB3F73B; Tue, 13 Sep 2022 02:06:16 -0700 (PDT) Message-ID: <976e07e6-cfef-da8b-1a08-bab4601fa433@arm.com> Date: Tue, 13 Sep 2022 14:36:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 13/16] mm/page_alloc: init local variable buddy_pfn Content-Language: en-US To: Miaohe Lin , akpm@linux-foundation.org Cc: david@redhat.com, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-14-linmiaohe@huawei.com> From: Anshuman Khandual In-Reply-To: <20220909092451.24883-14-linmiaohe@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/9/22 14:54, 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: Anshuman Khandual > --- > 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;