Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726729 > unrolled thread

[for-next][PATCH 1/2] ftrace: Fix selftest goto location on error

Started bySteven Rostedt <rostedt@goodmis.org>
First post2017-09-05 15:40 +0200
Last post2017-09-05 15:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [for-next][PATCH 1/2] ftrace: Fix selftest goto location on error Steven Rostedt <rostedt@goodmis.org> - 2017-09-05 15:40 +0200

#1726729 — [for-next][PATCH 1/2] ftrace: Fix selftest goto location on error

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-09-05 15:40 +0200
Subject[for-next][PATCH 1/2] ftrace: Fix selftest goto location on error
Message-ID<ummf8-3dY-21@gated-at.bofh.it>
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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>
---
 kernel/trace/trace_selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index cb917cebae29..b17ec642793b 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -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;
-- 
2.13.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web