diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2011-10-31 05:07:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-09 11:52:48 -0500 |
commit | eda31b190f7c7033b86ff6e8de3866a4ca25b7df (patch) | |
tree | ed17bff7b228d122699d232e4d62fe70bea64a08 /kernel/trace | |
parent | 4ebbdc2c9aad8e28e1335755c728d31032b24cfb (diff) |
tracing: fix event_subsystem ref counting
commit cb59974742aea24adf6637eb0c4b8e7b48bca6fb upstream.
Fix a bug introduced by e9dbfae5, which prevents event_subsystem from
ever being released.
Ref_count was added to keep track of subsystem users, not for counting
events. Subsystem is created with ref_count = 1, so there is no need to
increment it for every event, we have nr_events for that. Fix this by
touching ref_count only when we actually have a new user -
subsystem_open().
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Link: http://lkml.kernel.org/r/1320052062-7846-1-git-send-email-idryomov@gmail.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_events.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 3e2a7c91c54..2d049368242 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1096,7 +1096,6 @@ event_subsystem_dir(const char *name, struct dentry *d_events) | |||
1096 | /* First see if we did not already create this dir */ | 1096 | /* First see if we did not already create this dir */ |
1097 | list_for_each_entry(system, &event_subsystems, list) { | 1097 | list_for_each_entry(system, &event_subsystems, list) { |
1098 | if (strcmp(system->name, name) == 0) { | 1098 | if (strcmp(system->name, name) == 0) { |
1099 | __get_system(system); | ||
1100 | system->nr_events++; | 1099 | system->nr_events++; |
1101 | return system->entry; | 1100 | return system->entry; |
1102 | } | 1101 | } |