[PATCH 1/2] Fix mmap-thread-lookup.c unitialized memory usage

From: Numfor Mbiziwo-Tiapo
Date: Tue Jul 02 2019 - 13:37:23 EST


Running the perf test command after building perf with a memory
sanitizer causes a warning that says:
WARNING: MemorySanitizer: use-of-uninitialized-value... in mmap-thread-lookup.c
Initializing the go variable to 0 fixes this change.

Signed-off-by: Numfor Mbiziwo-Tiapo <nums@xxxxxxxxxx>
---
tools/perf/tests/mmap-thread-lookup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index 5ede9b561d32..b1abf4752f35 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -52,7 +52,7 @@ static void *thread_fn(void *arg)
{
struct thread_data *td = arg;
ssize_t ret;
- int go;
+ int go = 0;

if (thread_init(td))
return NULL;
--
2.22.0.410.gd8fdbe21b5-goog