]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ftrace: Fix selftest goto location on error
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 1 Sep 2017 16:04:09 +0000 (12:04 -0400)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 14:34:57 +0000 (10:34 -0400)
BugLink: http://bugs.launchpad.net/bugs/1720154
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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
kernel/trace/trace_selftest.c

index cb917cebae291bfbf00a86ea67e69d151b626e27..b17ec642793bc327e56f14d433a725dcff330f78 100644 (file)
@@ -273,7 +273,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;