Skip to content

Commit

Permalink
tracing: Fix a NULL vs IS_ERR() bug in event_subsystem_dir()
Browse files Browse the repository at this point in the history
commit 5264a2f upstream.

The eventfs_create_dir() function returns error pointers, it never returns
NULL.  Update the check to reflect that.

Link: https://lore.kernel.org/linux-trace-kernel/ff641474-84e2-46a7-9d7a-62b251a1050c@moroto.mountain

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 5790b1f ("eventfs: Remove eventfs_file and just use eventfs_inode")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Feb 23, 2024
1 parent 9389eaa commit 9e08372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_events.c
Expand Up @@ -2374,7 +2374,7 @@ event_subsystem_dir(struct trace_array *tr, const char *name,
nr_entries = ARRAY_SIZE(system_entries);

ei = eventfs_create_dir(name, parent, system_entries, nr_entries, dir);
if (!ei) {
if (IS_ERR(ei)) {
pr_warn("Failed to create system directory %s\n", name);
__put_system(system);
goto out_free;
Expand Down

0 comments on commit 9e08372

Please sign in to comment.