Skip to content

Commit 609e85a

Browse files
Alexander Z Lamrostedt
authored andcommitted
tracing: Fix error handling to ensure instances can always be removed
Remove debugfs directories for tracing instances during creation if an error occurs causing the trace_array for that instance to not be added to ftrace_trace_arrays. If the directory continues to exist after the error, it cannot be removed because the respective trace_array is not in ftrace_trace_arrays. Link: http://lkml.kernel.org/r/1373502874-1706-2-git-send-email-azl@google.com Cc: stable@vger.kernel.org # 3.10 Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Cc: David Sharp <dhsharp@google.com> Cc: Alexander Z Lam <lambchop468@gmail.com> Signed-off-by: Alexander Z Lam <azl@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent a232e27 commit 609e85a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎kernel/trace/trace.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5973,8 +5973,10 @@ static int new_instance_create(const char *name)
59735973
goto out_free_tr;
59745974

59755975
ret = event_trace_add_tracer(tr->dir, tr);
5976-
if (ret)
5976+
if (ret) {
5977+
debugfs_remove_recursive(tr->dir);
59775978
goto out_free_tr;
5979+
}
59785980

59795981
init_tracer_debugfs(tr, tr->dir);
59805982

0 commit comments

Comments
 (0)