Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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: 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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 */