Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1730969rwn; Fri, 9 Sep 2022 03:14:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR66J9rE7UhdrBHtoDydum0EtjFOf4ahHNfD4rUPwFvWbrlqtKQEMS69gHnPIqeoNGS/O0JY X-Received: by 2002:a17:90b:2243:b0:1f4:e8a4:8c38 with SMTP id hk3-20020a17090b224300b001f4e8a48c38mr9118514pjb.136.1662718465419; Fri, 09 Sep 2022 03:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662718465; cv=none; d=google.com; s=arc-20160816; b=siEz2sh9pO8y2XDIo6GHEpuH+w+DHgYvc+6jBuZ4r00MIiGEzHkFbFB29Ys99SWu9x telrlo+qQxzwygf+7dJqkJXyM6dtXJiUzUsDNj7AtxxJ9cWGEn33drHbPo5vhC+yFWGu dMRpqLX8dHnBjuoWP3rI3JtLZ53+P28L5YegecgYSMJB9LZTsbQ2jt/2oZGqfnJ3m+Sn Iyj4jyBSQGFx1eanHjEzOOOCM/4NDs5lbcpRDUurdBvwvxW4E0o/XaFpUFTZAYmWz1hR wFj0ZfiJ11T/5tUu/a2Fcz8xsQOp55tH9xitdNt6mpBS7Z2ziIvfu+IG/cHqsIWLxbhF t6iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lGorzbx2/799i8C3hn9fMwaX24G2PgzNoWDpcLkVKzc=; b=ZBE7ZXe9q2mD8IqmBBm2+szp8Ws6mJIFRVF/7PQzSr9lk3tzfkeyeYgo99oOVxcB3M 6NLpjxEQWN4HHXoRUGOmLphQZwyKVY6MeVrPpyzN+a1Pf/qQ6z6kihdHM/NbxTxG9l6K lpaUmOBbhGhTYOU7liKYdMwg3uFuIsdeHYJcPckJKNPr/Lw8IPX3Vvcy39eF18qCHlG4 ZAEXbo+8SVJbUxh/7i/VsohCe2ZYrlYiR6Y57QQACglKNhsDZk2zdCtldzEaxJmdhFSF G8NP2lJcX6dxgvuSqT3gcOmnrmpVdxEjiVzbAjvPVnH0d4XzNebp9OO6QhPFDqhcO9rG h+Yw== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a170902ee8200b0016d9c8479b5si120987pld.344.2022.09.09.03.14.13; Fri, 09 Sep 2022 03:14:25 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232239AbiIIJ2f (ORCPT + 99 others); Fri, 9 Sep 2022 05:28:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231381AbiIIJ07 (ORCPT ); Fri, 9 Sep 2022 05:26:59 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AF9FA692 for ; Fri, 9 Sep 2022 02:25:33 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9TS02pRzZcmJ; Fri, 9 Sep 2022 17:21:00 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:31 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 13/16] mm/page_alloc: init local variable buddy_pfn Date: Fri, 9 Sep 2022 17:24:48 +0800 Message-ID: <20220909092451.24883-14-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 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; -- 2.23.0