rust_binderfs: fix a dentry leak

Parallel to binderfs patches - 02da8d2c09 "binderfs_binder_ctl_create():
kill a bogus check" and the bit of b89aa54482 "convert binderfs" that
got lost when making 4433d8e25d "convert rust_binderfs"; the former is
a cleanup, the latter is about marking /binder-control persistent, so that
it would be taken out on umount.

Fixes: 4433d8e25d ("convert rust_binderfs")
Acked-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2026-01-26 01:05:57 -05:00
parent 63804fed14
commit 351ea48ae8

View file

@ -391,12 +391,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
if (!device)
return -ENOMEM;
/* If we have already created a binder-control node, return. */
if (info->control_dentry) {
ret = 0;
goto out;
}
ret = -ENOMEM;
inode = new_inode(sb);
if (!inode)
@ -431,7 +425,8 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
inode->i_private = device;
info->control_dentry = dentry;
d_add(dentry, inode);
d_make_persistent(dentry, inode);
dput(dentry);
return 0;