Impact: fix crash during perfcounters use
I found another counter free path, create a free_counter() call to
accomodate generic tear-down.
Fixes an RCU bug.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Orig-LKML-Reference: <
20090319194233.
652078652@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kfree(counter);
}
+static void free_counter(struct perf_counter *counter)
+{
+ call_rcu(&counter->rcu_head, free_counter_rcu);
+}
+
/*
* Called when the last reference to the file is gone.
*/
mutex_unlock(&counter->mutex);
mutex_unlock(&ctx->mutex);
- call_rcu(&counter->rcu_head, free_counter_rcu);
+ free_counter(counter);
put_context(ctx);
return 0;
list_entry) {
if (sub->parent) {
sync_child_counter(sub, sub->parent);
- kfree(sub);
+ free_counter(sub);
}
}
- kfree(child_counter);
+ free_counter(child_counter);
}
}