Commit 29ef1c8e authored by Christian Brauner's avatar Christian Brauner Committed by Greg Kroah-Hartman

binderfs: drop lock in binderfs_binder_ctl_create

The binderfs_binder_ctl_create() call is a no-op on subsequent calls and
the first call is done before we unlock the suberblock. Hence, there is no
need to take inode_lock() in there. Let's remove it.
Suggested-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarChristian Brauner <christian@brauner.io>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 41984795
...@@ -400,8 +400,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb) ...@@ -400,8 +400,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
if (!device) if (!device)
return -ENOMEM; return -ENOMEM;
inode_lock(d_inode(root));
/* If we have already created a binder-control node, return. */ /* If we have already created a binder-control node, return. */
if (info->control_dentry) { if (info->control_dentry) {
ret = 0; ret = 0;
...@@ -440,12 +438,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb) ...@@ -440,12 +438,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
inode->i_private = device; inode->i_private = device;
info->control_dentry = dentry; info->control_dentry = dentry;
d_add(dentry, inode); d_add(dentry, inode);
inode_unlock(d_inode(root));
return 0; return 0;
out: out:
inode_unlock(d_inode(root));
kfree(device); kfree(device);
iput(inode); iput(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment