From 1ce4bebec27a6a1fc813c42d5ce9b2a67d50f82d Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Tue, 27 Aug 2019 00:37:05 -0500 Subject: [PATCH] Initialize dirp in topology_create_temp_cpu_cache_list to NULL. Avoids uninitialized use in early exit (error) paths. Change-Id: I5fb24863f0a5da48776608d47f25e1c8d8aafe35 [ROCm/ROCR-Runtime commit: 8ab8b149021d10549eb21ab411f03a4a0ed06999] --- projects/rocr-runtime/src/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/src/topology.c b/projects/rocr-runtime/src/topology.c index b008d338d9..1538cfae83 100644 --- a/projects/rocr-runtime/src/topology.c +++ b/projects/rocr-runtime/src/topology.c @@ -1166,7 +1166,7 @@ static int topology_create_temp_cpu_cache_list(int node, int max_cpus; cpu_cacheinfo_t *this_cpu; /* one cpu_ci in cpu_ci_list */ int cache_cnt = 0; - DIR *dirp; + DIR *dirp = NULL; struct dirent *dir; char *p;