summaryrefslogtreecommitdiffstats
path: root/kernel/trace/kprobe_event_gen_test.c
diff options
context:
space:
mode:
authorAnton Gusev <aagusev@ispras.ru>2023-01-31 08:58:18 +0100
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-19 17:20:48 +0100
commitbc4f359b3b607daac0290d0038561237a86b38cb (patch)
tree266fcfde507458aaaef103cb17f8d2a3c3b5c22f /kernel/trace/kprobe_event_gen_test.c
parenttracing: Make tracepoint lockdep check actually test something (diff)
downloadlinux-bc4f359b3b607daac0290d0038561237a86b38cb.tar.xz
linux-bc4f359b3b607daac0290d0038561237a86b38cb.zip
tracing: Fix wrong return in kprobe_event_gen_test.c
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>
Diffstat (limited to 'kernel/trace/kprobe_event_gen_test.c')
-rw-r--r--kernel/trace/kprobe_event_gen_test.c4
1 files 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;
}