From: Steven Rostedt (Red Hat) Date: Thu, 9 May 2013 15:35:12 +0000 (-0400) Subject: ftrace: Have ftrace_regex_write() return either read or error X-Git-Tag: firefly_0821_release~3680^2~483^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7c088b5120ffef017e2ddc38f992277e96436ef6;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Steven Rostedt --- 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, ret = ftrace_process_regex(iter->hash, parser->buffer, parser->idx, enable); trace_parser_clear(parser); - if (ret) + if (ret < 0) goto out_unlock; }