summaryrefslogtreecommitdiffstats
path: root/drivers/base/cacheinfo.c
diff options
context:
space:
mode:
authorPierre Gondois <pierre.gondois@arm.com>2023-01-24 16:40:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-31 16:02:02 +0100
commitecaef469920fd6d2c7687f19081946f47684a423 (patch)
tree066e6ef43e8ef6bdc9138bf42a0bd4d4edb35504 /drivers/base/cacheinfo.c
parent2b8e35337605ca581f777cad73d7a6ac2ccbf6ec (diff)
downloadlinux-ecaef469920fd6d2c7687f19081946f47684a423.tar.gz
linux-ecaef469920fd6d2c7687f19081946f47684a423.tar.bz2
linux-ecaef469920fd6d2c7687f19081946f47684a423.zip
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 <lkp@intel.com> Link: https://lore.kernel.org/all/202301052307.JYt1GWaJ-lkp@intel.com/ Reported-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/all/Y86iruJPuwNN7rZw@kili/ Fixes: 5944ce092b97 ("arch_topology: Build cacheinfo from primary CPU") Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230124154053.355376-2-pierre.gondois@arm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/cacheinfo.c')
-rw-r--r--drivers/base/cacheinfo.c2
1 files changed, 1 insertions, 1 deletions
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) {