From: Andy Zhou Date: Wed, 15 Jul 2015 20:22:00 +0000 (-0700) Subject: perf-counter: initialize perf counter shash before use X-Git-Tag: v2.5.0~910 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=cd747abb601183ab6f10420d5637951d5d4c6206 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 --- 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