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 7A2A5ECAAD3 for ; Fri, 9 Sep 2022 11:36:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 193D18D0005; Fri, 9 Sep 2022 07:36:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 143C68D0002; Fri, 9 Sep 2022 07:36:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00C1F8D0005; Fri, 9 Sep 2022 07:36:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E66CF8D0002 for ; Fri, 9 Sep 2022 07:36:14 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BA48940854 for ; Fri, 9 Sep 2022 11:36:14 +0000 (UTC) X-FDA: 79892343468.03.C93C948 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 56E84C009B for ; Fri, 9 Sep 2022 11:36:14 +0000 (UTC) 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-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-370-UEyknqNIOOmfC7rS4iVQKA-1; Fri, 09 Sep 2022 07:36:12 -0400 X-MC-Unique: UEyknqNIOOmfC7rS4iVQKA-1 Received: by mail-wm1-f69.google.com with SMTP id c188-20020a1c35c5000000b003b2dee5fb58so726652wma.5 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=VoLEvXxcMLpr7F/3SLziN3rmuSCMWFtNN5vVkiEmh2m75kEG88MSQJgAkARJmY09Ee qTW2nZl7tTwv9zSJi+JgJnqCaCJM1COP7bH8CZW/7LbGAfpuZmeqQtPIxxqmy3q8WJjb HOQcNqFKeGIl7gbHi/Ze2Rm1G1Ak1t6HK/5d+YKD7w75lr99VwMVUGaiCDudbf76u8bL yYobmBraUC3mH/3daDetdoAv0Zff3/TA8+xomMwdcpRj+KejfV7pqLzkV11RuPRKYo7F CbwR8pAL67bhNOiqOGLOEh8oC+KuSTaZQ7LxXDApLCNc9z7vrZtVNWr+RPx3Ar4AmeIt l7bw== X-Gm-Message-State: ACgBeo3NwvxLdrGxU8poGuyRVOwKfvfOZZ+lKo6p/9HaPNRQshs5QBXg KrTLdqZu+GTS7iiRmantUO5dRHVIZTVWCq641IgUX8d7lGvogRpyyzBlBJOHtaEi19SKBkEwPAc 41ppUm2nG8WU= X-Received: by 2002:a05:600c:3c84:b0:3a6:9596:fa1f with SMTP id bg4-20020a05600c3c8400b003a69596fa1fmr5180365wmb.162.1662723371614; Fri, 09 Sep 2022 04:36:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hTek+xtlkUNfx14F+65SKYij81qgrbT2VYd/sA2LVlUyUPG72J8QFETT1EALRbjv2ceGvqA== 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 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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662723374; a=rsa-sha256; cv=none; b=uGEC5elMxGHrqzImaB/6OZqL4kjMH6w8blYh4UijPh3+4W34Qb3tmkEodyeXQcKxz7xQcg wIL4GeK8IucZEH5X7C0AvCmD6ZHtjBqCfa8g3aYlJUtGuQheIYjK+20XJAexkasgq6c4s7 dnDrSs/bfShD79crwABZPRfPqk+gPw0= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=R5V2QELU; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662723374; 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=maZfD0oCjFCM4aCFs68Cg66zWCeM1I3js7vDr3fDq20=; b=nggOesBJVrt5XToIflwwvRhgPV/9hDkaGltOLmH2zpkT3ofmlCGVFeBEUqTGZO66YQd7U5 dtUYOLBJnjWH62Dl7tpIlQe+vD+ecDRxPX/F/ch848Ug9n7UmyY9wKeVOtkOqZrYB+64OO BMgW8DrpeGv89Tcrve8kB8MADkrRoWQ= X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: krpunc83a9q46x8w53g1jt9mfhin4uyn X-Rspamd-Queue-Id: 56E84C009B Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=R5V2QELU; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1662723374-757191 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 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