Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cb9e4c1 authored by Christian Brauner's avatar Christian Brauner Committed by Hridya Valsaraju
Browse files

UPSTREAM: 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>

Bug: 136497735
(cherry picked from commit 29ef1c8e16aed079ac09989d752e38d412b6e1a8)
Change-Id: I7c294796ac7891f62387e09dc34332ca4c3ee67b
Signed-off-by: default avatarHridya Valsaraju <hridya@google.com>
parent dd9111f9
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -400,8 +400,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
	if (!device)
		return -ENOMEM;

	inode_lock(d_inode(root));

	/* If we have already created a binder-control node, return. */
	if (info->control_dentry) {
		ret = 0;
@@ -440,12 +438,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
	inode->i_private = device;
	info->control_dentry = dentry;
	d_add(dentry, inode);
	inode_unlock(d_inode(root));

	return 0;

out:
	inode_unlock(d_inode(root));
	kfree(device);
	iput(inode);