mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 05:44:45 +01:00
rust_binderfs: fix a dentry leak
Parallel to binderfs patches -02da8d2c09"binderfs_binder_ctl_create(): kill a bogus check" and the bit ofb89aa54482"convert binderfs" that got lost when making4433d8e25d"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:
parent
63804fed14
commit
351ea48ae8
1 changed files with 2 additions and 7 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue