Skip to content

Commit bc4f359

Browse files
Anton Gusevrostedt
authored andcommitted
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 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/[email protected] Signed-off-by: Anton Gusev <[email protected]> Reviewed-by: Steven Rostedt (Google) <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent c267925 commit bc4f359

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/kprobe_event_gen_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void)
146146
if (trace_event_file_is_valid(gen_kprobe_test))
147147
gen_kprobe_test = NULL;
148148
/* We got an error after creating the event, delete it */
149-
ret = kprobe_event_delete("gen_kprobe_test");
149+
kprobe_event_delete("gen_kprobe_test");
150150
goto out;
151151
}
152152

@@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void)
211211
if (trace_event_file_is_valid(gen_kretprobe_test))
212212
gen_kretprobe_test = NULL;
213213
/* We got an error after creating the event, delete it */
214-
ret = kprobe_event_delete("gen_kretprobe_test");
214+
kprobe_event_delete("gen_kretprobe_test");
215215
goto out;
216216
}
217217

0 commit comments

Comments
 (0)