Commit 6ea6215f authored by zhangwei(Jovi)'s avatar zhangwei(Jovi) Committed by Steven Rostedt

tracing/uprobes: Fix uprobe_cpu_buffer memory leak

Forgot to free uprobe_cpu_buffer percpu page in uprobe_buffer_disable().

Link: http://lkml.kernel.org/p/534F8B3F.1090407@huawei.com

Cc: stable@vger.kernel.org # v3.14+
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarzhangwei(Jovi) <jovi.zhangwei@huawei.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 5d6c97c5
......@@ -732,9 +732,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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment