Commit c96abaec authored by Quanfa Fu's avatar Quanfa Fu Committed by Masami Hiramatsu (Google)
Browse files

tracing/eprobe: no need to check for negative ret value for snprintf

No need to check for negative return value from snprintf() as the
code does not return negative values.

Link: https://lore.kernel.org/all/20230109040625.3259642-1-quanfafu@gmail.com/



Signed-off-by: default avatarQuanfa Fu <quanfafu@gmail.com>
Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
parent 1fcd09fd
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -923,17 +923,13 @@ static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const ch

	p = ep->filter_str;
	for (i = 0; i < argc; i++) {
		if (i)
			ret = snprintf(p, len, " %s", argv[i]);
		else
			ret = snprintf(p, len, "%s", argv[i]);
		if (ret < 0)
			goto error;
		if (ret > len) {
			ret = -E2BIG;
			goto error;
		}
		p += ret;
		len -= ret;
	}
	p[-1] = '\0';

	/*
	 * Ensure the filter string can be parsed correctly. Note, this