[PATCH -next v2 1/3] cacheinfo: Initialize variables in fetch_cache_info()
Pierre Gondois
pierre.gondois at arm.com
Tue Jan 24 07:40:46 PST 2023
Set potentially uninitialized variables to 0. This is particularly
relevant when CONFIG_ACPI_PPTT is not set.
Reported-by: kernel test robot <lkp at intel.com>
Link: https://lore.kernel.org/all/202301052307.JYt1GWaJ-lkp@intel.com/
Reported-by: Dan Carpenter <error27 at 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 at arm.com>
---
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
More information about the linux-arm-kernel
mailing list