diff options
author | Divya Indi <divya.indi@oracle.com> | 2019-08-14 10:55:25 -0700 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-11-13 09:37:29 -0500 |
commit | 953ae45a0c25e09428d4a03d7654f97ab8a36647 (patch) | |
tree | 9a80b253fdd9a4a5bd5c03934a98d98672988bf7 /kernel/trace/trace_events.c | |
parent | e585e6469d6f476b82aa148dc44aaf7ae269a4e2 (diff) | |
download | linux-953ae45a0c25e09428d4a03d7654f97ab8a36647.tar.gz linux-953ae45a0c25e09428d4a03d7654f97ab8a36647.tar.bz2 linux-953ae45a0c25e09428d4a03d7654f97ab8a36647.zip |
tracing: Adding NULL checks for trace_array descriptor pointer
As part of commit f45d1225adb0 ("tracing: Kernel access to Ftrace
instances") we exported certain functions. Here, we are adding some additional
NULL checks to ensure safe usage by users of these APIs.
Link: http://lkml.kernel.org/r/1565805327-579-4-git-send-email-divya.indi@oracle.com
Signed-off-by: Divya Indi <divya.indi@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index fba87d10f0c1..2a3ac2365445 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -793,6 +793,8 @@ int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) char *event = NULL, *sub = NULL, *match; int ret; + if (!tr) + return -ENOENT; /* * The buf format can be <subsystem>:<event-name> * *:<event-name> means any event by that name. |