ftrace: Fix synchronization location disabling and freeing ftrace_ops
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 7 Feb 2014 19:42:01 +0000 (14:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:48:03 +0000 (13:48 -0800)
commitb6c5a8d32c2e2fea5a574365cef91bbfe75d861c
tree670e73b402865f56e09bc659b8f3f3b0a85a712c
parenta0d0a2a5a36361f7695bb243bf7ea499f0c82fd2
ftrace: Fix synchronization location disabling and freeing ftrace_ops

commit a4c35ed241129dd142be4cadb1e5a474a56d5464 upstream.

The synchronization needed after ftrace_ops are unregistered must happen
after the callback is disabled from becing called by functions.

The current location happens after the function is being removed from the
internal lists, but not after the function callbacks were disabled, leaving
the functions susceptible of being called after their callbacks are freed.

This affects perf and any externel users of function tracing (LTTng and
SystemTap).

Fixes: cdbe61bfe704 "ftrace: Allow dynamically allocated function tracers"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ftrace.c