|
@@ -1237,7 +1237,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
|
|
|
}
|
|
|
|
|
|
/* only spaces were written */
|
|
|
- if (isspace(ch)) {
|
|
|
+ if (isspace(ch) || !ch) {
|
|
|
*ppos += read;
|
|
|
ret = read;
|
|
|
goto out;
|
|
@@ -1247,7 +1247,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
|
|
|
}
|
|
|
|
|
|
/* read the non-space input */
|
|
|
- while (cnt && !isspace(ch)) {
|
|
|
+ while (cnt && !isspace(ch) && ch) {
|
|
|
if (parser->idx < parser->size - 1)
|
|
|
parser->buffer[parser->idx++] = ch;
|
|
|
else {
|
|
@@ -1262,7 +1262,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
|
|
|
}
|
|
|
|
|
|
/* We either got finished input or we have to wait for another call. */
|
|
|
- if (isspace(ch)) {
|
|
|
+ if (isspace(ch) || !ch) {
|
|
|
parser->buffer[parser->idx] = 0;
|
|
|
parser->cont = false;
|
|
|
} else if (parser->idx < parser->size - 1) {
|