All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anton Gusev <aagusev@ispras.ru>
Subject: [for-linus][PATCH 1/8] tracing: Fix wrong return in kprobe_event_gen_test.c
Date: Sun, 19 Mar 2023 12:46:44 -0400	[thread overview]
Message-ID: <20230319164747.891800732@goodmis.org> (raw)
In-Reply-To: 20230319164643.513018619@goodmis.org

From: Anton Gusev <aagusev@ispras.ru>

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.

Link: https://lore.kernel.org/linux-trace-kernel/20230131075818.5322-1-aagusev@ispras.ru

Signed-off-by: Anton Gusev <aagusev@ispras.ru>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.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 4850fdfe27f1..5a4b722b5045 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

  reply	other threads:[~2023-03-19 16:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
2023-03-19 16:46 ` Steven Rostedt [this message]
2023-03-19 16:46 ` [for-linus][PATCH 2/8] tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 3/8] trace/hwlat: Do not wipe the contents of per-cpu thread data Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 4/8] trace/hwlat: Do not start per-cpu thread if it is already running Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 5/8] ftrace: Set direct_ops storage-class-specifier to static Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 6/8] tracing: Make splice_read available again Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 7/8] ring-buffer: remove obsolete comment for free_buffer_page() Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 8/8] tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr Steven Rostedt

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=20230319164747.891800732@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=aagusev@ispras.ru \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.