From: Linyu Yuan <quic_linyyuan@quicinc.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Tom Zanussi <zanussi@kernel.org>
Cc: <kernel-janitors@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] tracing: react to error return from traceprobe_parse_event_name()
Date: Thu, 11 Aug 2022 16:48:25 +0800 [thread overview]
Message-ID: <458d93ba-ff78-54e7-5639-bee89e61ce19@quicinc.com> (raw)
In-Reply-To: <20220811071734.20700-1-lukas.bulwahn@gmail.com>
thanks,
Acked-by: Linyu Yuan <quic_linyyuan@quicinc.com>
On 8/11/2022 3:17 PM, Lukas Bulwahn wrote:
> The function traceprobe_parse_event_name() may set the first two function
> arguments to a non-null value and still return -EINVAL to indicate an
> unsuccessful completion of the function. Hence, it is not sufficient to
> just check the result of the two function arguments for being not null,
> but the return value also needs to be checked.
>
> Commit 95c104c378dc ("tracing: Auto generate event name when creating a
> group of events") changed the error-return-value checking of the second
> traceprobe_parse_event_name() invocation in __trace_eprobe_create() and
> removed checking the return value to jump to the error handling case.
>
> Reinstate using the return value in the error-return-value checking.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> kernel/trace/trace_eprobe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> index 4a0e9d927443..550671985fd1 100644
> --- a/kernel/trace/trace_eprobe.c
> +++ b/kernel/trace/trace_eprobe.c
> @@ -883,7 +883,7 @@ static int __trace_eprobe_create(int argc, const char *argv[])
> trace_probe_log_set_index(1);
> sys_event = argv[1];
> ret = traceprobe_parse_event_name(&sys_event, &sys_name, buf2, 0);
> - if (!sys_event || !sys_name) {
> + if (ret || !sys_event || !sys_name) {
> trace_probe_log_err(0, NO_EVENT_INFO);
> goto parse_error;
> }
prev parent reply other threads:[~2022-08-11 8:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 7:17 [PATCH v2] tracing: react to error return from traceprobe_parse_event_name() Lukas Bulwahn
2022-08-11 8:48 ` Linyu Yuan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=458d93ba-ff78-54e7-5639-bee89e61ce19@quicinc.com \
--to=quic_linyyuan@quicinc.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=zanussi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox