From: Pierre Gondois Date: Tue, 24 Jan 2023 15:40:46 +0000 (+0100) Subject: cacheinfo: Initialize variables in fetch_cache_info() X-Git-Tag: v6.3-rc1~106^2~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ecaef469920fd6d2c7687f19081946f47684a423;p=thirdparty%2Fkernel%2Flinux.git cacheinfo: Initialize variables in fetch_cache_info() 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 Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230124154053.355376-2-pierre.gondois@arm.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 418a18acc8f9e..f6573c335f4c4 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) {