]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
eventfs: Remove extra dget() in eventfs_create_events_dir()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 6 Feb 2024 12:09:19 +0000 (07:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:25:20 +0000 (09:25 +0100)
commit810a957e343bc44c2fe8aeee073a515fa0a5541e
tree79f3f9001cc9c3491bc53760b516c260e09a6548
parent7cac392f5640b054f5d596fa913f9ad4d4df2565
eventfs: Remove extra dget() in eventfs_create_events_dir()

commit 77bc4d4921bd3497678ba8e7f4e480de35692f05 upstream.

The creation of the top events directory does a dget() at the end of the
creation in eventfs_create_events_dir() with a comment saying the final
dput() will happen when it is removed. The problem is that a dget() is
already done on the dentry when it was created with tracefs_start_creating()!
The dget() now just causes a memory leak of that dentry.

Remove the extra dget() as the final dput() in the deletion of the events
directory actually matches the one in tracefs_start_creating().

Link: https://lore.kernel.org/linux-trace-kernel/20231031124229.4f2e3fa1@gandalf.local.home
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/tracefs/event_inode.c