From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Divya Indi <divya.indi@oracle.com>, <linux-kernel@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Aruna Ramakrishna <aruna.ramakrishna@oracle.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH] sample-trace-array: Remove trace_array 'sample-instance'
Date: Tue, 9 Jun 2020 13:52:00 +0000 [thread overview]
Message-ID: <20200609135200.2206726-1-wangkefeng.wang@huawei.com> (raw)
Remove trace_array 'sample-instance' if kthread_run fails
in sample_trace_array_init().
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
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.27.0
next reply other threads:[~2020-06-09 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 13:52 Kefeng Wang [this message]
2020-06-09 16:30 ` Divya Indi
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=20200609135200.2206726-1-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=aruna.ramakrishna@oracle.com \
--cc=divya.indi@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®