Merge branch 'tracing-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / kernel / trace / trace_functions_graph.c
index 10f6ad7d85f655e9bea1fa8af0ef868138dfa5f7..8b592418d8b28953a28e40c2202a50cb2b40dd37 100644 (file)
@@ -65,6 +65,12 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth)
        if (!current->ret_stack)
                return -EBUSY;
 
+       /*
+        * We must make sure the ret_stack is tested before we read
+        * anything else.
+        */
+       smp_rmb();
+
        /* The return trace stack is full */
        if (current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) {
                atomic_inc(&current->trace_overrun);