Skip to content

Commit 76638d9

Browse files
Changbin Durostedt
authored andcommitted
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/[email protected] Acked-by: Namhyung Kim <[email protected]> Signed-off-by: Changbin Du <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 921a7ac commit 76638d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,14 +1236,14 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
12361236
cnt--;
12371237
}
12381238

1239+
parser->idx = 0;
1240+
12391241
/* only spaces were written */
12401242
if (isspace(ch) || !ch) {
12411243
*ppos += read;
12421244
ret = read;
12431245
goto out;
12441246
}
1245-
1246-
parser->idx = 0;
12471247
}
12481248

12491249
/* read the non-space input */

0 commit comments

Comments
 (0)