[PATCH] tracing: fix event system memory leak
From: Li Zefan
Date: Fri Oct 28 2011 - 02:57:55 EST
system->ref_count = system->nr_events + ref_count for opening "enable"
and "filter"
so when removing a module, it's wrong to drop ref_count only when nr_events
drops to 0.
Cc: stable <stable@xxxxxxxxxx>
Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>
---
kernel/trace/trace_events.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 581876f..281a60a 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1252,8 +1252,8 @@ static void remove_subsystem_dir(const char *name)
if (!--system->nr_events) {
debugfs_remove_recursive(system->entry);
list_del(&system->list);
- __put_system(system);
}
+ __put_system(system);
break;
}
}
--
1.7.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/