projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
921a7ac
)
tracing: Clear parser->idx if only spaces are read
author
Changbin Du
<changbin.du@intel.com>
Tue, 16 Jan 2018 09:02:29 +0000
(17:02 +0800)
committer
Steven Rostedt (VMware)
<rostedt@goodmis.org>
Tue, 23 Jan 2018 20:57:28 +0000
(15:57 -0500)
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>
kernel/trace/trace.c
patch
|
blob
|
history
diff --git
a/kernel/trace/trace.c
b/kernel/trace/trace.c
index c00a31d18f8a43d7e68a86065cd50e2985cae077..cb90435e63da44a9ef3007c4d3793b2fe91b4964 100644
(file)
--- 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,
cnt--;
}
+ parser->idx = 0;
+
/* only spaces were written */
if (isspace(ch) || !ch) {
*ppos += read;
ret = read;
goto out;
}
-
- parser->idx = 0;
}
/* read the non-space input */