Skip to content

Commit

Permalink
ftrace: Test for NULL iter->tr in regex for stack_trace_filter changes
Browse files Browse the repository at this point in the history
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: 8c08f0d ("ftrace: Have cached module filters be an active filter")
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
rostedt committed Jul 5, 2017
1 parent 4dce17b commit 69d7187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 69d7187

Please sign in to comment.