--- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9006,8 +9006,10 @@ static int trace_array_create_dir(struct return -EINVAL; ret = event_trace_add_tracer(tr->dir, tr); - if (ret) + if (ret) { tracefs_remove(tr->dir); + return ret; + } init_tracer_tracefs(tr, tr->dir); __update_tracer_options(tr);