summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorzhangwei(Jovi) <jovi.zhangwei@huawei.com>2014-04-17 16:05:19 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-31 13:20:29 -0700
commitff3db3fa612bedd7fa2c6ed3f32f850929f2c7d7 (patch)
tree5e7d856faed46a3d4d8d51ebf30d99f125aa2878 /kernel
parent0aa769c91d405d6bee480513ae490fe1360e74ae (diff)
tracing/uprobes: Fix uprobe_cpu_buffer memory leak
commit 6ea6215fe394e320468589d9bba464a48f6d823a upstream. Forgot to free uprobe_cpu_buffer percpu page in uprobe_buffer_disable(). Link: http://lkml.kernel.org/p/534F8B3F.1090407@huawei.com Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_uprobe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 79e52d93860b..bd0c9b133b54 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -728,9 +728,15 @@ static int uprobe_buffer_enable(void)
static void uprobe_buffer_disable(void)
{
+ int cpu;
+
BUG_ON(!mutex_is_locked(&event_mutex));
if (--uprobe_buffer_refcnt == 0) {
+ for_each_possible_cpu(cpu)
+ free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer,
+ cpu)->buf);
+
free_percpu(uprobe_cpu_buffer);
uprobe_cpu_buffer = NULL;
}