oprofile, arm: initialize perf_event pointers with NULL
Robert Richter [Mon, 30 Aug 2010 16:21:55 +0000 (18:21 +0200)]
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>

arch/arm/oprofile/common.c

index c3652f7..d660cb8 100644 (file)
@@ -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,