diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-09-01 18:04:09 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-09-01 18:04:09 +0200 |
commit | 46320a6acc4fb58f04bcf78c4c942cc43b20f986 (patch) | |
tree | 26cae67bb94bfc0ef030a2d437e001fefcd1aa3b /kernel | |
parent | ftrace: Zero out ftrace hashes when a module is removed (diff) | |
download | linux-46320a6acc4fb58f04bcf78c4c942cc43b20f986.tar.xz linux-46320a6acc4fb58f04bcf78c4c942cc43b20f986.zip |
ftrace: Fix selftest goto location on error
In the second iteration of trace_selftest_ops(), the error goto label is
wrong in the case where trace_selftest_test_global_cnt is off. In the
case of error, it leaks the dynamic ops that was allocated.
Cc: stable@vger.kernel.org
Fixes: 95950c2e ("ftrace: Add self-tests for multiple function trace users")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_selftest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index cb917cebae29..b17ec642793b 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c @@ -273,7 +273,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt) goto out_free; if (cnt > 1) { if (trace_selftest_test_global_cnt == 0) - goto out; + goto out_free; } if (trace_selftest_test_dyn_cnt == 0) goto out_free; |