diff options
author | Steven Rostedt <srostedt@redhat.com> | 2012-11-02 21:01:20 (GMT) |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-01-23 04:37:58 (GMT) |
commit | 9640388b63556b4cfecbb5aaf91a5c99d272f429 (patch) | |
tree | 517d07d5f3d1e10aa795fe334db40adf0321922f | |
parent | 6350379452ccaeaa71734adf57dec2ebc9207849 (diff) | |
download | linux-fsl-qoriq-9640388b63556b4cfecbb5aaf91a5c99d272f429.tar.xz |
ftrace: Fix function tracing recursion self test
The function tracing recursion self test should not crash
the machine if the resursion test fails. If it detects that
the function tracing is recursing when it should not be, then
bail, don't go into an infinite recursive loop.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace_selftest.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index adb008a..51c819c 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c @@ -415,7 +415,8 @@ static void trace_selftest_test_recursion_func(unsigned long ip, * The ftrace infrastructure should provide the recursion * protection. If not, this will crash the kernel! */ - trace_selftest_recursion_cnt++; + if (trace_selftest_recursion_cnt++ > 10) + return; DYN_FTRACE_TEST_NAME(); } |