From: Namhyung Kim Date: Mon, 23 Apr 2012 01:11:57 +0000 (+0900) Subject: tracing: Check return value of tracing_dentry_percpu() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a3d7ce7e6caa8c39cb5184bd9047a01a40abc2a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Cc: Ingo Molnar Signed-off-by: Namhyung Kim Signed-off-by: Steven Rostedt --- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index dfbd86cc487..0ed4df0c6a3 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4474,6 +4474,9 @@ static void tracing_init_debugfs_percpu(long cpu) struct dentry *d_cpu; char cpu_dir[30]; /* 30 characters should be more than enough */ + if (!d_percpu) + return; + snprintf(cpu_dir, 30, "cpu%ld", cpu); d_cpu = debugfs_create_dir(cpu_dir, d_percpu); if (!d_cpu) {