diff options
author | Changbin Du <changbin.du@intel.com> | 2018-01-16 04:02:29 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-01-23 15:57:28 -0500 |
commit | 76638d96502744b0d593f2386b75ae5a017c13bb (patch) | |
tree | cb6b25e2586657ecd8adb61deae7a3ebc00f8247 /kernel/trace/trace.c | |
parent | 921a7acd85ebbab1b3cd99828e6842fd3e78df24 (diff) |
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.com
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index c00a31d18f8a..cb90435e63da 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1236,14 +1236,14 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf, | |||
1236 | cnt--; | 1236 | cnt--; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | parser->idx = 0; | ||
1240 | |||
1239 | /* only spaces were written */ | 1241 | /* only spaces were written */ |
1240 | if (isspace(ch) || !ch) { | 1242 | if (isspace(ch) || !ch) { |
1241 | *ppos += read; | 1243 | *ppos += read; |
1242 | ret = read; | 1244 | ret = read; |
1243 | goto out; | 1245 | goto out; |
1244 | } | 1246 | } |
1245 | |||
1246 | parser->idx = 0; | ||
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | /* read the non-space input */ | 1249 | /* read the non-space input */ |