From: Alexander Z Lam Date: Thu, 11 Jul 2013 00:34:34 +0000 (-0700) Subject: tracing: Fix error handling to ensure instances can always be removed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a33eb1f5e1ae58418d9853c794a40d340605d752;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git tracing: Fix error handling to ensure instances can always be removed commit 609e85a70bcd0eedf4ec60639dbcfb1ab011e054 upstream. 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 Signed-off-by: Alexander Z Lam Cc: Vaibhav Nagarnaik Cc: David Sharp Cc: Alexander Z Lam Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0b936d80665..9109d60e2f2 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5926,8 +5926,10 @@ static int new_instance_create(const char *name) goto out_free_tr; ret = event_trace_add_tracer(tr->dir, tr); - if (ret) + if (ret) { + debugfs_remove_recursive(tr->dir); goto out_free_tr; + } init_tracer_debugfs(tr, tr->dir);