From cd747abb601183ab6f10420d5637951d5d4c6206 Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Wed, 15 Jul 2015 13:22:00 -0700 Subject: [PATCH] perf-counter: initialize perf counter shash before use Private variable perf_counters needs to be initialized before use. Otherwise, perf_counter_init() call will cause crashes. Signed-off-by: Andy Zhou Acked-by: Ben Pfaff --- lib/perf-counter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/perf-counter.c b/lib/perf-counter.c index 8c859cc76..62e2d76dd 100644 --- a/lib/perf-counter.c +++ b/lib/perf-counter.c @@ -31,7 +31,7 @@ #include "shash.h" #include "util.h" -static struct shash perf_counters; +static struct shash perf_counters = SHASH_INITIALIZER(&perf_counters); static int fd__ = 0; uint64_t -- 2.20.1