diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-05-09 11:35:12 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-05-09 11:35:12 -0400 |
commit | 7c088b5120ffef017e2ddc38f992277e96436ef6 (patch) | |
tree | 9cfeea9e1adc62a0e0ee452bdcbb6fc748358b6d /kernel/trace | |
parent | ff305ded9ff83436039a16d31bc558dc6598d7ce (diff) |
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: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8a5c017bb50c..d85a0ad81a67 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -3276,7 +3276,7 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
3276 | ret = ftrace_process_regex(iter->hash, parser->buffer, | 3276 | ret = ftrace_process_regex(iter->hash, parser->buffer, |
3277 | parser->idx, enable); | 3277 | parser->idx, enable); |
3278 | trace_parser_clear(parser); | 3278 | trace_parser_clear(parser); |
3279 | if (ret) | 3279 | if (ret < 0) |
3280 | goto out_unlock; | 3280 | goto out_unlock; |
3281 | } | 3281 | } |
3282 | 3282 | ||