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

Commit 7c088b51 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt
Browse files

ftrace: Have ftrace_regex_write() return either read or error



As ftrace_regex_write() reads the result of ftrace_process_regex()
which can sometimes return a positive number, only consider a
failure if the return is negative. Otherwise, it will skip possible
other registered probes and by returning a positive number that
wasn't read, it will confuse the user processes doing the writing.

Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent ff305ded
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3276,7 +3276,7 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
		ret = ftrace_process_regex(iter->hash, parser->buffer,
		ret = ftrace_process_regex(iter->hash, parser->buffer,
					   parser->idx, enable);
					   parser->idx, enable);
		trace_parser_clear(parser);
		trace_parser_clear(parser);
		if (ret)
		if (ret < 0)
			goto out_unlock;
			goto out_unlock;
	}
	}