Skip to content

Commit 77bc4d4

Browse files
committed
eventfs: Remove extra dget() in eventfs_create_events_dir()
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: 5790b1f ("eventfs: Remove eventfs_file and just use eventfs_inode") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent bb32500 commit 77bc4d4

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

fs/tracefs/event_inode.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,6 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
774774
fsnotify_mkdir(dentry->d_parent->d_inode, dentry);
775775
tracefs_end_creating(dentry);
776776

777-
/* Will call dput when the directory is removed */
778-
dget(dentry);
779-
780777
return ei;
781778

782779
fail:

0 commit comments

Comments
 (0)