Commit bc4f359b authored by Anton Gusev's avatar Anton Gusev Committed by Steven Rostedt (Google)

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 b111545d
("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.ruSigned-off-by: default avatarAnton Gusev <aagusev@ispras.ru>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent c2679254
...@@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void) ...@@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void)
if (trace_event_file_is_valid(gen_kprobe_test)) if (trace_event_file_is_valid(gen_kprobe_test))
gen_kprobe_test = NULL; gen_kprobe_test = NULL;
/* We got an error after creating the event, delete it */ /* 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; goto out;
} }
...@@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void) ...@@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void)
if (trace_event_file_is_valid(gen_kretprobe_test)) if (trace_event_file_is_valid(gen_kretprobe_test))
gen_kretprobe_test = NULL; gen_kretprobe_test = NULL;
/* We got an error after creating the event, delete it */ /* 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; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment