Skip to content

Commit

Permalink
tracing: Fix wrong return in kprobe_event_gen_test.c
Browse files Browse the repository at this point in the history
Overwriting the error code with the deletion result may cause the
function to return 0 despite encountering an error. Commit b111545
("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>
  • Loading branch information
Anton Gusev authored and rostedt committed Mar 19, 2023
1 parent c267925 commit bc4f359
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/trace/kprobe_event_gen_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit bc4f359

Please sign in to comment.