Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Remove unnecessary check for EVENT_FILE_FL_FREED

The event_filter_write() function calls event_file_file() to retrieve
a trace_event_file associated with a given file struct. If a non-NULL
pointer is returned, the function then checks whether the trace_event_file
instance has the EVENT_FILE_FL_FREED flag set. This check is redundant
because event_file_file() already performs this validation and returns NULL
if the flag is set. The err value is also already initialized to -ENODEV.

Remove the unnecessary check for EVENT_FILE_FL_FREED in
event_filter_write().

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20260219162737.314231-4-petr.pavlu@suse.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Petr Pavlu and committed by
Steven Rostedt (Google)
f55c09da 473e470f

+2 -6
+2 -6
kernel/trace/trace_events.c
··· 2247 2247 2248 2248 mutex_lock(&event_mutex); 2249 2249 file = event_file_file(filp); 2250 - if (file) { 2251 - if (file->flags & EVENT_FILE_FL_FREED) 2252 - err = -ENODEV; 2253 - else 2254 - err = apply_event_filter(file, buf); 2255 - } 2250 + if (file) 2251 + err = apply_event_filter(file, buf); 2256 2252 mutex_unlock(&event_mutex); 2257 2253 2258 2254 kfree(buf);