diff options
| author | Christian Brauner <christian@brauner.io> | 2019-01-21 05:48:07 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-22 06:25:53 -0500 |
| commit | 29ef1c8e16aed079ac09989d752e38d412b6e1a8 (patch) | |
| tree | e0afd0214cb6525f771e79c8488dccf11c85e92b /drivers/android | |
| parent | 4198479524aeccaf53c3a4cc73784982535573fa (diff) | |
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: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christian Brauner <christian@brauner.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android')
| -rw-r--r-- | drivers/android/binderfs.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index ba88be172aee..d537dcdb5d65 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c | |||
| @@ -400,8 +400,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb) | |||
| 400 | if (!device) | 400 | if (!device) |
| 401 | return -ENOMEM; | 401 | return -ENOMEM; |
| 402 | 402 | ||
| 403 | inode_lock(d_inode(root)); | ||
| 404 | |||
| 405 | /* If we have already created a binder-control node, return. */ | 403 | /* If we have already created a binder-control node, return. */ |
| 406 | if (info->control_dentry) { | 404 | if (info->control_dentry) { |
| 407 | ret = 0; | 405 | ret = 0; |
| @@ -440,12 +438,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb) | |||
| 440 | inode->i_private = device; | 438 | inode->i_private = device; |
| 441 | info->control_dentry = dentry; | 439 | info->control_dentry = dentry; |
| 442 | d_add(dentry, inode); | 440 | d_add(dentry, inode); |
| 443 | inode_unlock(d_inode(root)); | ||
| 444 | 441 | ||
| 445 | return 0; | 442 | return 0; |
| 446 | 443 | ||
| 447 | out: | 444 | out: |
| 448 | inode_unlock(d_inode(root)); | ||
| 449 | kfree(device); | 445 | kfree(device); |
| 450 | iput(inode); | 446 | iput(inode); |
| 451 | 447 | ||
