Commit 76638d96 authored by Changbin Du's avatar Changbin Du Committed by Steven Rostedt (VMware)

tracing: Clear parser->idx if only spaces are read

If only spaces were read while parsing the next string, then parser->idx should be
cleared in order to make trace_parser_loaded() return false.

Link: http://lkml.kernel.org/r/1516093350-12045-3-git-send-email-changbin.du@intel.comAcked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 921a7acd
...@@ -1236,14 +1236,14 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf, ...@@ -1236,14 +1236,14 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
cnt--; cnt--;
} }
parser->idx = 0;
/* only spaces were written */ /* only spaces were written */
if (isspace(ch) || !ch) { if (isspace(ch) || !ch) {
*ppos += read; *ppos += read;
ret = read; ret = read;
goto out; goto out;
} }
parser->idx = 0;
} }
/* read the non-space input */ /* read the non-space input */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment