Skip to content

Commit 46320a6

Browse files
committed
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: [email protected] Fixes: 95950c2 ("ftrace: Add self-tests for multiple function trace users") Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 2a5bfe4 commit 46320a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_selftest.c

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

0 commit comments

Comments
 (0)