Skip to content

Commit

Permalink
oprofile, arm: initialize perf_event pointers with NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Richter committed Aug 31, 2010
1 parent c7fd239 commit 4cbe75b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
{
int cpu, ret = 0;

memset(&perf_events, 0, sizeof(perf_events));

perf_num_counters = armpmu_get_max_events();

counter_config = kcalloc(perf_num_counters,
Expand Down

0 comments on commit 4cbe75b

Please sign in to comment.