Skip to content

Commit

Permalink
ftrace: Fix selftest goto location on error
Browse files Browse the repository at this point in the history
commit 46320a6 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: 95950c2 ("ftrace: Add self-tests for multiple function trace users")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
rostedt authored and gregkh committed Sep 27, 2017
1 parent 2a913ae commit df865f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_selftest.c
Expand Up @@ -272,7 +272,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;
Expand Down

0 comments on commit df865f8

Please sign in to comment.