diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-04-22 21:11:57 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-05-16 19:50:37 -0400 |
commit | 0a3d7ce7e6caa8c39cb5184bd9047a01a40abc2a (patch) | |
tree | c273c4024b2e1f9b8d4701108e05770e8d4515a9 /kernel/trace | |
parent | 308f7eeb7882c27c1d7aa783499cb22f3b199718 (diff) |
tracing: Check return value of tracing_dentry_percpu()
If tracing_dentry_percpu() failed, tracing_init_debugfs_percpu()
will try to create each cpu directories on debugfs' root directory
as d_percpu is NULL.
Link: http://lkml.kernel.org/r/1335143517-2285-1-git-send-email-namhyung.kim@lge.com
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index dfbd86cc4876..0ed4df0c6a39 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4474,6 +4474,9 @@ static void tracing_init_debugfs_percpu(long cpu) | |||
4474 | struct dentry *d_cpu; | 4474 | struct dentry *d_cpu; |
4475 | char cpu_dir[30]; /* 30 characters should be more than enough */ | 4475 | char cpu_dir[30]; /* 30 characters should be more than enough */ |
4476 | 4476 | ||
4477 | if (!d_percpu) | ||
4478 | return; | ||
4479 | |||
4477 | snprintf(cpu_dir, 30, "cpu%ld", cpu); | 4480 | snprintf(cpu_dir, 30, "cpu%ld", cpu); |
4478 | d_cpu = debugfs_create_dir(cpu_dir, d_percpu); | 4481 | d_cpu = debugfs_create_dir(cpu_dir, d_percpu); |
4479 | if (!d_cpu) { | 4482 | if (!d_cpu) { |