Commit 4cbe75be5c6ae86bdc7daec864eeb2dfd66f48bb

Authored by Robert Richter
1 parent c7fd239a64

oprofile, arm: initialize perf_event pointers with NULL

The pointers must be NULL'ed to avoid double-freeing the pointers in
rare cases during reinitialization.

Signed-off-by: Robert Richter <robert.richter@amd.com>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

arch/arm/oprofile/common.c
... ... @@ -351,6 +351,8 @@
351 351 {
352 352 int cpu, ret = 0;
353 353  
  354 + memset(&perf_events, 0, sizeof(perf_events));
  355 +
354 356 perf_num_counters = armpmu_get_max_events();
355 357  
356 358 counter_config = kcalloc(perf_num_counters,