Skip to content

Commit 0c588ac

Browse files
paolonigrostedt
authored andcommitted
tracing: fix return value in __ftrace_event_enable_disable for TRACE_REG_UNREGISTER
When __ftrace_event_enable_disable invokes the class callback to unregister the event, the return value is not reported up to the caller, hence leading to event unregister failures being silently ignored. This patch assigns the ret variable to the invocation of the event unregister callback, so that its return value is stored and reported to the caller, and it raises a warning in case of error. Link: https://lore.kernel.org/20250321170821.101403-1-gpaoloni@redhat.com Signed-off-by: Gabriele Paoloni <gpaoloni@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 7e6b3fc commit 0c588ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/trace/trace_events.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,9 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file,
790790
clear_bit(EVENT_FILE_FL_RECORDED_TGID_BIT, &file->flags);
791791
}
792792

793-
call->class->reg(call, TRACE_REG_UNREGISTER, file);
793+
ret = call->class->reg(call, TRACE_REG_UNREGISTER, file);
794+
795+
WARN_ON_ONCE(ret);
794796
}
795797
/* If in SOFT_MODE, just set the SOFT_DISABLE_BIT, else clear it */
796798
if (file->flags & EVENT_FILE_FL_SOFT_MODE)

0 commit comments

Comments
 (0)