summaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-07-05 15:45:43 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-07-05 15:52:18 +0200
commit69d71879d2cf67a381055f698a1d7def00dc4ed7 (patch)
treebfca8b6145348c973eb6c880e614c22a6a2065e0 /kernel/trace/ftrace.c
parentMerge commit '0f17976568b3f72e676450af0c0db6f8752253d6' into trace/ftrace/core (diff)
downloadlinux-69d71879d2cf67a381055f698a1d7def00dc4ed7.tar.xz
linux-69d71879d2cf67a381055f698a1d7def00dc4ed7.zip
ftrace: Test for NULL iter->tr in regex for stack_trace_filter changes
As writing into stack_trace_filter, the iter-tr is not set and is NULL. Check if it is NULL before dereferencing it in ftrace_regex_release(). Fixes: 8c08f0d5c6fb ("ftrace: Have cached module filters be an active filter") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f8c18f15b190..2953d558bbee 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5043,7 +5043,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file)
if (filter_hash) {
orig_hash = &iter->ops->func_hash->filter_hash;
- if (!list_empty(&iter->tr->mod_trace))
+ if (iter->tr && !list_empty(&iter->tr->mod_trace))
iter->hash->flags |= FTRACE_HASH_FL_MOD;
} else
orig_hash = &iter->ops->func_hash->notrace_hash;