trace-cmd: Add sanity check of tracefs_get_tracing_file() input parameter.

The input parameter "name" of tracefs_get_tracing_file() API is mandatory,
it cannot be NULL. A check is added to verify this.

Link: http://lore.kernel.org/linux-trace-devel/20200129095421.881786-4-tz.stoyanov@gmail.com

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
diff --git a/tracefs-utils.c b/tracefs-utils.c
index de46aab..227990a 100644
--- a/tracefs-utils.c
+++ b/tracefs-utils.c
@@ -161,6 +161,9 @@
 	char *file;
 	int ret;
 
+	if (!name)
+		return NULL;
+
 	if (!tracing) {
 		tracing = tracefs_find_tracing_dir();
 		if (!tracing)