Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69d71879 authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware)
Browse files

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: 8c08f0d5 ("ftrace: Have cached module filters be an active filter")
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 4dce17b2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -5043,7 +5043,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file)


		if (filter_hash) {
		if (filter_hash) {
			orig_hash = &iter->ops->func_hash->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;
				iter->hash->flags |= FTRACE_HASH_FL_MOD;
		} else
		} else
			orig_hash = &iter->ops->func_hash->notrace_hash;
			orig_hash = &iter->ops->func_hash->notrace_hash;