Commit 753154fc authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware) Committed by Greg Kroah-Hartman

ftrace: Fix selftest goto location on error

commit 46320a6a upstream.

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.

Fixes: 95950c2e ("ftrace: Add self-tests for multiple function trace users")
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d8663aa2
...@@ -272,7 +272,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt) ...@@ -272,7 +272,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt)
goto out_free; goto out_free;
if (cnt > 1) { if (cnt > 1) {
if (trace_selftest_test_global_cnt == 0) if (trace_selftest_test_global_cnt == 0)
goto out; goto out_free;
} }
if (trace_selftest_test_dyn_cnt == 0) if (trace_selftest_test_dyn_cnt == 0)
goto out_free; goto out_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment