From fb8f42233d09f46115471766d31aacbb1ad4d851 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 24 Jan 2023 18:32:47 +0000 Subject: [PATCH] Fix unitialized variable warning in valgrind Change-Id: I91e70d67671a8f7289b734407011380b6b97238a --- src/topology.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/topology.c b/src/topology.c index 0f5c0f9706..d808a2d84f 100644 --- a/src/topology.c +++ b/src/topology.c @@ -539,6 +539,8 @@ static int get_cpu_cache_info(const char *prefix, struct proc_cpuinfo *cpuinfo, fscanf_dec(path, &this_cache->CacheLevel); /* CacheType */ snprintf(path, 256, "%s/index%d/type", prefix, idx); + + memset(str, 0, sizeof(str)); fscanf_str(path, str); if (!strcmp(str, "Data")) this_cache->CacheType.ui32.Data = 1;