ftrace: Fix synchronization location disabling and freeing ftrace_ops
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 13 Jan 2014 17:56:21 +0000 (12:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:55:44 +0000 (13:55 -0800)
commit35f3b5faa50652b6bb35e9e3b39bdb7c8c761e71
tree5bb97c3366e3d4daec6f51c08976cfa94ea8c27c
parente78005e749fd384eeefec1820c10ae57fb213500
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