Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1822090rwn; Fri, 9 Sep 2022 04:46:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR4VZDUFCJQKcCW4O7pSBqi32hAINSh+qQS8lDgyJoBIfv1rbO02/VfxG+j09qtpqrjCCpGV X-Received: by 2002:a2e:87d9:0:b0:26a:ceee:c77b with SMTP id v25-20020a2e87d9000000b0026aceeec77bmr3803955ljj.275.1662723990312; Fri, 09 Sep 2022 04:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662723990; cv=none; d=google.com; s=arc-20160816; b=aRvD6ClPxcHm8TllYgp+XbjN8NjSQYY0RG7sz6M3LSvqR2ups2OeSyCKsAEIqu/Rr/ SSslKbyNEJ0dcLportO5aAGHZcDiyPC50Bp3BqhQW6oT5Spy4IX0dUrfPfCYoVf8rydN PDHKanXnSpt6S+8bIr36wVHo0PrtpGWDYKs9Yx+wg8Ny0JRPiij2QsUB6yoW4JaEeWr2 binBXTzYfO8fIhjKcDbntYflT/580UABarLAfNQgnq7TWOm3k5sZlK50X+gPe/9uim/Y LetFi0JfsKUBu8AMUBW5LvAVhDgWh9VG9plhLypyisDuVxmu5JG9VD1RdKb5W5LjOoaQ 7rSw== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=maZfD0oCjFCM4aCFs68Cg66zWCeM1I3js7vDr3fDq20=; b=P+JvXoLtIaPx7VcWXkRW9dJ25DcAdF030h1wt79Lr5fdQreBvqv9ikEKVBf2aIldml t2c3c+MRC3DwgAJy4oN2A4OA1lv1WB1dIT1gpQSLyGHoYN3htk0X8ulgTD9IZ6esgArg nhJLDRYPRbc5l1Dq0BpXFv4vaSOqJW4FDboBNRyrdl1AplcUh06vVLGjlrK5kPnFvA1h EdNpVKajxvhpFiTGEb7+Ub306Ly+Onq05XiYqcc7gJoaDIeSSTKTLPL0MHMFxdINDZLJ ha9NUie/T++xpP6ZSOnxH/nvTCXUBvAeIQVTUtO/lPaFtTM2wLMfDIp4Vktkuxg1VKJ5 XYqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5V2QELU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a2ea791000000b00261e194c2b0si162475ljf.330.2022.09.09.04.45.54; Fri, 09 Sep 2022 04:46:30 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5V2QELU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbiIILgR (ORCPT + 99 others); Fri, 9 Sep 2022 07:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiIILgP (ORCPT ); Fri, 9 Sep 2022 07:36:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A108C12EDA6 for ; Fri, 9 Sep 2022 04:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662723373; h=from:from: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; bh=maZfD0oCjFCM4aCFs68Cg66zWCeM1I3js7vDr3fDq20=; b=R5V2QELUlUFfjrufr0N8XxoOyVMhBdlu/cAluWc4GES28ybTZJ7urPqnixiDB6QQ5EMwFR moTKv1UvmYVvqAwn9V/suwADzJcjiWI9cvdgDHAtCV+EtzUdSmyZI+jYEDSxjKbghXd0/3 ceRrfgWHbN7RvHHAGFjotM+IFxVZywg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-495-3kfynIhbOSqFtYhKwMfkzg-1; Fri, 09 Sep 2022 07:36:12 -0400 X-MC-Unique: 3kfynIhbOSqFtYhKwMfkzg-1 Received: by mail-wm1-f72.google.com with SMTP id o25-20020a05600c339900b003b2973dab88so727008wmp.6 for ; Fri, 09 Sep 2022 04:36:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=maZfD0oCjFCM4aCFs68Cg66zWCeM1I3js7vDr3fDq20=; b=IhAnwocl+Fyb3Oc9KaMQ4p1GPAss4X4+TnaprwIHaLOcfMNvLEYfMq/UjnpvbWIIJL WCYMihMT7JNQkitiNtbHzxOdYkXzmwIDtWzgJ5sYLfYeCg6ejohDGSNRtDCEqafGt5UR 0jaPoC1kRlO1mD1vFiBlD/ny7ms3M17GSW0R9NEMtMOJgLdYGoi9jghqhB30axnENbS0 fnBYh9R0BBK5v6ZBGt2LUUvHl7WKX2K94FiH5mUMRZUXOMdzxzZu+f+fHCY5MDs0hpye JESGbbvXq03NgYpSR6pGgCGtAjxael5px2pajaqTkCEX2OM80h+E/EbEj86MNGKzPCfD 3YrQ== X-Gm-Message-State: ACgBeo2+Lyp5Qiset7B2xIQzY4rra7Z1+SPJz33bGihSaE+cwQViy2ed IH24Ozvakjwh+FGVxoCMl+IjgAi2Cdorlo2PbMgar0+O4r64rM1qPPUBwuEW2v4r7BLF60NuoX1 Oz2UIw79M8ZqAZJ58ZnU8DuYx X-Received: by 2002:a05:600c:3c84:b0:3a6:9596:fa1f with SMTP id bg4-20020a05600c3c8400b003a69596fa1fmr5180367wmb.162.1662723371615; Fri, 09 Sep 2022 04:36:11 -0700 (PDT) X-Received: by 2002:a05:600c:3c84:b0:3a6:9596:fa1f with SMTP id bg4-20020a05600c3c8400b003a69596fa1fmr5180345wmb.162.1662723371293; Fri, 09 Sep 2022 04:36:11 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:6300:1fe0:42e1:62c5:91b6? (p200300cbc70463001fe042e162c591b6.dip0.t-ipconnect.de. [2003:cb:c704:6300:1fe0:42e1:62c5:91b6]) by smtp.gmail.com with ESMTPSA id k5-20020a5d5185000000b0022863c18b93sm325531wrv.13.2022.09.09.04.36.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 04:36:10 -0700 (PDT) Message-ID: <50964afc-e1be-9356-fff9-8c0d89000cea@redhat.com> Date: Fri, 9 Sep 2022 13:36:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.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: 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: David Hildenbrand Organization: Red Hat In-Reply-To: <20220909092451.24883-14-linmiaohe@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,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 09.09.22 11:24, 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 > --- > 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; Yeah, why not. Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb