From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
stable@vger.kernel.org, Divya Indi <divya.indi@oracle.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [for-linus][PATCH 08/17] sample-trace-array: Remove trace_array sample-instance
Date: Thu, 18 Jun 2020 19:56:04 -0400 [thread overview]
Message-ID: <20200618235640.338463687@goodmis.org> (raw)
In-Reply-To: 20200618235556.451120786@goodmis.org
From: Kefeng Wang <wangkefeng.wang@huawei.com>
Remove trace_array 'sample-instance' if kthread_run fails
in sample_trace_array_init().
Link: https://lkml.kernel.org/r/20200609135200.2206726-1-wangkefeng.wang@huawei.com
Cc: stable@vger.kernel.org
Fixes: 89ed42495ef4a ("tracing: Sample module to demonstrate kernel access to Ftrace instances.")
Reviewed-by: Divya Indi <divya.indi@oracle.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
samples/ftrace/sample-trace-array.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/samples/ftrace/sample-trace-array.c b/samples/ftrace/sample-trace-array.c
index 9e437f930280..6aba02a31c96 100644
--- a/samples/ftrace/sample-trace-array.c
+++ b/samples/ftrace/sample-trace-array.c
@@ -115,8 +115,12 @@ static int __init sample_trace_array_init(void)
trace_printk_init_buffers();
simple_tsk = kthread_run(simple_thread, NULL, "sample-instance");
- if (IS_ERR(simple_tsk))
+ if (IS_ERR(simple_tsk)) {
+ trace_array_put(tr);
+ trace_array_destroy(tr);
return -1;
+ }
+
return 0;
}
--
2.26.2
next prev parent reply other threads:[~2020-06-18 23:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 23:55 [for-linus][PATCH 00/17] tracing: Updates for 5.8 Steven Rostedt
2020-06-18 23:55 ` [for-linus][PATCH 01/17] recordmcount: support >64k sections Steven Rostedt
2020-06-18 23:55 ` [for-linus][PATCH 02/17] kprobes: Suppress the suspicious RCU warning on kprobes Steven Rostedt
2020-06-18 23:55 ` [for-linus][PATCH 03/17] kprobes: Use non RCU traversal APIs on kprobe_tables if possible Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 04/17] kprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 05/17] kprobes: Remove redundant arch_disarm_kprobe() call Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 06/17] kretprobe: Prevent triggering kretprobe from within kprobe_flush_task Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 07/17] sample-trace-array: Fix sleeping function called from invalid context Steven Rostedt
2020-06-18 23:56 ` Steven Rostedt [this message]
2020-06-18 23:56 ` [for-linus][PATCH 09/17] tracing: Make ftrace packed events have align of 1 Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 10/17] trace: Fix typo in allocate_ftrace_ops()s comment Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 11/17] tracing/probe: Fix memleak in fetch_op_data operations Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 12/17] tracing: Remove unused event variable in tracing_iter_reset Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 13/17] proc/bootconfig: Fix to use correct quotes for value Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 14/17] tools/bootconfig: " Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 15/17] tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 16/17] tools/bootconfig: Add testcase for show-command and quotes test Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 17/17] ftrace: Fix maybe-uninitialized compiler warning Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200618235640.338463687@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=divya.indi@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox