Skip to content

Commit d8a6431

Browse files
bulwahnrostedt
authored andcommitted
tracing: React to error return from traceprobe_parse_event_name()
The function traceprobe_parse_event_name() may set the first two function arguments to a non-null value and still return -EINVAL to indicate an unsuccessful completion of the function. Hence, it is not sufficient to just check the result of the two function arguments for being not null, but the return value also needs to be checked. Commit 95c104c ("tracing: Auto generate event name when creating a group of events") changed the error-return-value checking of the second traceprobe_parse_event_name() invocation in __trace_eprobe_create() and removed checking the return value to jump to the error handling case. Reinstate using the return value in the error-return-value checking. Link: https://lkml.kernel.org/r/20220811071734.20700-1-lukas.bulwahn@gmail.com Fixes: 95c104c ("tracing: Auto generate event name when creating a group of events") Acked-by: Linyu Yuan <quic_linyyuan@quicinc.com> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent f1a15b9 commit d8a6431

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/trace_eprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static int __trace_eprobe_create(int argc, const char *argv[])
883883
trace_probe_log_set_index(1);
884884
sys_event = argv[1];
885885
ret = traceprobe_parse_event_name(&sys_event, &sys_name, buf2, 0);
886-
if (!sys_event || !sys_name) {
886+
if (ret || !sys_event || !sys_name) {
887887
trace_probe_log_err(0, NO_EVENT_INFO);
888888
goto parse_error;
889889
}

0 commit comments

Comments
 (0)