summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-09-01 12:04:09 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-27 10:57:21 +0200
commit45a521cba61051409ea2b932104ab6767e7b68b4 (patch)
treeaeb11b7085d22d04bf477fa82be0c084bf71b12e /kernel
parent78d88643d218fccb0fcf7fa957e785d4048e35cb (diff)
downloadlinux-stable-45a521cba61051409ea2b932104ab6767e7b68b4.tar.gz
linux-stable-45a521cba61051409ea2b932104ab6767e7b68b4.tar.bz2
linux-stable-45a521cba61051409ea2b932104ab6767e7b68b4.zip
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: 95950c2e ("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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_selftest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index b0f86ea77881..ca70d11b8aa7 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -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;