[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20230201003753.d844d26d902169ee64b979d4@kernel.org>
Date: Wed, 1 Feb 2023 00:37:53 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Anton Gusev <aagusev@...ras.ru>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing: Fix wrong return in kprobe_event_gen_test.c
On Tue, 31 Jan 2023 10:58:18 +0300
Anton Gusev <aagusev@...ras.ru> wrote:
> Overwriting the error code with the deletion result may cause the
> function to return 0 despite encountering an error. Commit b111545d26c0
> ("tracing: Remove the useless value assignment in
> test_create_synth_event()") solves a similar issue by
> returning the original error code, so this patch does the same.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Anton Gusev <aagusev@...ras.ru>
Oops, thanks for the fix!
Acked-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> ---
> kernel/trace/kprobe_event_gen_test.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/kprobe_event_gen_test.c b/kernel/trace/kprobe_event_gen_test.c
> index c736487fc0e4..e0c420eb0b2b 100644
> --- a/kernel/trace/kprobe_event_gen_test.c
> +++ b/kernel/trace/kprobe_event_gen_test.c
> @@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void)
> if (trace_event_file_is_valid(gen_kprobe_test))
> gen_kprobe_test = NULL;
> /* We got an error after creating the event, delete it */
> - ret = kprobe_event_delete("gen_kprobe_test");
> + kprobe_event_delete("gen_kprobe_test");
> goto out;
> }
>
> @@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void)
> if (trace_event_file_is_valid(gen_kretprobe_test))
> gen_kretprobe_test = NULL;
> /* We got an error after creating the event, delete it */
> - ret = kprobe_event_delete("gen_kretprobe_test");
> + kprobe_event_delete("gen_kretprobe_test");
> goto out;
> }
>
> --
> 2.39.1
>
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists