Skip to content

Commit 0a3d7ce

Browse files
Namhyung Kimrostedt
authored andcommitted
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>
1 parent 308f7ee commit 0a3d7ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/trace/trace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,6 +4474,9 @@ static void tracing_init_debugfs_percpu(long cpu)
44744474
struct dentry *d_cpu;
44754475
char cpu_dir[30]; /* 30 characters should be more than enough */
44764476

4477+
if (!d_percpu)
4478+
return;
4479+
44774480
snprintf(cpu_dir, 30, "cpu%ld", cpu);
44784481
d_cpu = debugfs_create_dir(cpu_dir, d_percpu);
44794482
if (!d_cpu) {

0 commit comments

Comments
 (0)