diff --git a/samples/ftrace/sample-trace-array.c b/samples/ftrace/sample-trace-array.c index 9e437f930280fee6cc22712043f4c1fd058e8758..6aba02a31c96c52d24804aad834b9a169c8c318f 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; }