From: Al Viro Date: Fri, 9 May 2025 03:38:01 +0000 (-0400) Subject: securityfs: don't pin dentries twice, once is enough... X-Git-Tag: v6.17-rc1~230^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27cd1bf1240d482e4f02ca4f9812e748f3106e4f;p=thirdparty%2Flinux.git securityfs: don't pin dentries twice, once is enough... incidentally, securityfs_recursive_remove() is broken without that - it leaks dentries, since simple_recursive_removal() does not expect anything of that sort. It could be worked around by dput() in remove_one() callback, but it's easier to just drop that double-get stuff. Signed-off-by: Al Viro --- diff --git a/security/inode.c b/security/inode.c index 3913501621fa9..93460eab8216b 100644 --- a/security/inode.c +++ b/security/inode.c @@ -159,7 +159,6 @@ static struct dentry *securityfs_create_dentry(const char *name, umode_t mode, inode->i_fop = fops; } d_instantiate(dentry, inode); - dget(dentry); inode_unlock(dir); return dentry; @@ -306,7 +305,6 @@ void securityfs_remove(struct dentry *dentry) simple_rmdir(dir, dentry); else simple_unlink(dir, dentry); - dput(dentry); } inode_unlock(dir); simple_release_fs(&mount, &mount_count);