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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B24CC38142 for ; Tue, 24 Jan 2023 15:41:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235300AbjAXPlc (ORCPT ); Tue, 24 Jan 2023 10:41:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235283AbjAXPlR (ORCPT ); Tue, 24 Jan 2023 10:41:17 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8BBF4C0DD for ; Tue, 24 Jan 2023 07:41:15 -0800 (PST) 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 33A0BC14; Tue, 24 Jan 2023 07:41:57 -0800 (PST) Received: from cam-smtp0.cambridge.arm.com (pierre123.nice.arm.com [10.34.100.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 01B003F5A1; Tue, 24 Jan 2023 07:41:12 -0800 (PST) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven , Conor Dooley , Dan Carpenter , Pierre Gondois , kernel test robot , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Palmer Dabbelt , Oliver Upton , Akihiko Odaki , Gavin Shan , Jeremy Linton , linux-arm-kernel@lists.infradead.org Subject: [PATCH -next v2 1/3] cacheinfo: Initialize variables in fetch_cache_info() Date: Tue, 24 Jan 2023 16:40:46 +0100 Message-Id: <20230124154053.355376-2-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230124154053.355376-1-pierre.gondois@arm.com> References: <20230124154053.355376-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set potentially uninitialized variables to 0. This is particularly relevant when CONFIG_ACPI_PPTT is not set. Reported-by: kernel test robot Link: https://lore.kernel.org/all/202301052307.JYt1GWaJ-lkp@intel.com/ Reported-by: Dan Carpenter Link: https://lore.kernel.org/all/Y86iruJPuwNN7rZw@kili/ Fixes: 5944ce092b97 ("arch_topology: Build cacheinfo from primary CPU") Signed-off-by: Pierre Gondois --- drivers/base/cacheinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 418a18acc8f9..f6573c335f4c 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -424,7 +424,7 @@ int allocate_cache_info(int cpu) int fetch_cache_info(unsigned int cpu) { struct cpu_cacheinfo *this_cpu_ci; - unsigned int levels, split_levels; + unsigned int levels = 0, split_levels = 0; int ret; if (acpi_disabled) { -- 2.25.1