Skip to content

Commit

Permalink
sample-trace-array: Remove trace_array 'sample-instance'
Browse files Browse the repository at this point in the history
Remove trace_array 'sample-instance' if kthread_run fails
in sample_trace_array_init().

Link: https://lkml.kernel.org/r/[email protected]

Cc: [email protected]
Fixes: 89ed424 ("tracing: Sample module to demonstrate kernel access to Ftrace instances.")
Reviewed-by: Divya Indi <[email protected]>
Signed-off-by: Kefeng Wang <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
Kefeng Wang authored and rostedt committed Jun 17, 2020
1 parent e9b7b1c commit 9fbc01c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion samples/ftrace/sample-trace-array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9fbc01c

Please sign in to comment.