Skip to content

Commit

Permalink
perf-counter: initialize perf counter shash before use
Browse files Browse the repository at this point in the history
Private variable perf_counters needs to be initialized before
use. Otherwise,  perf_counter_init() call will cause crashes.

Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed Jul 17, 2015
1 parent 8b34ccd commit cd747ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/perf-counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd747ab

Please sign in to comment.