Skip to content

Commit 753154f

Browse files
rostedtgregkh
authored andcommitted
ftrace: Fix selftest goto location on error
commit 46320a6acc4fb58f04bcf78c4c942cc43b20f986 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>
1 parent d8663aa commit 753154f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/trace_selftest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static int trace_selftest_ops(struct trace_array *tr, int cnt)
272272
goto out_free;
273273
if (cnt > 1) {
274274
if (trace_selftest_test_global_cnt == 0)
275-
goto out;
275+
goto out_free;
276276
}
277277
if (trace_selftest_test_dyn_cnt == 0)
278278
goto out_free;

0 commit comments

Comments
 (0)