Commit 9fbc01cd authored by Kefeng Wang's avatar Kefeng Wang Committed by Steven Rostedt (VMware)

sample-trace-array: Remove trace_array 'sample-instance'

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: 89ed4249 ("tracing: Sample module to demonstrate kernel access to Ftrace instances.")
Reviewed-by: default avatarDivya Indi <divya.indi@oracle.com>
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent e9b7b1c0
...@@ -115,8 +115,12 @@ static int __init sample_trace_array_init(void) ...@@ -115,8 +115,12 @@ static int __init sample_trace_array_init(void)
trace_printk_init_buffers(); trace_printk_init_buffers();
simple_tsk = kthread_run(simple_thread, NULL, "sample-instance"); 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 -1;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment