Browse Source

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>
Steven Rostedt (VMware) 8 years ago
parent
commit
46320a6acc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kernel/trace/trace_selftest.c

+ 1 - 1
kernel/trace/trace_selftest.c

@@ -273,7 +273,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;