tracing/uprobes: Fix the usage of uprobe_buffer_enable() in probe_event_enable()
authorOleg Nesterov <oleg@redhat.com>
Fri, 27 Jun 2014 17:01:46 +0000 (19:01 +0200)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 30 Jun 2014 17:22:33 +0000 (13:22 -0400)
commitfb6bab6a5ad46d00b5ffa22268f21df1cd7c59df
treecf20fd01e563ee6a4b659d30ab48de0fb015f584
parentf786106e8081bbec57053fec7fcf25dc25d02144
tracing/uprobes: Fix the usage of uprobe_buffer_enable() in probe_event_enable()

The usage of uprobe_buffer_enable() added by dcad1a20 is very wrong,

1. uprobe_buffer_enable() and uprobe_buffer_disable() are not balanced,
   _enable() should be called only if !enabled.

2. If uprobe_buffer_enable() fails probe_event_enable() should clear
   tp.flags and free event_file_link.

3. If uprobe_register() fails it should do uprobe_buffer_disable().

Link: http://lkml.kernel.org/p/20140627170146.GA18332@redhat.com
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Fixes: dcad1a204f72 "tracing/uprobes: Fetch args before reserving a ring buffer"
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_uprobe.c