aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmail.com>2019-05-06 19:01:02 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-20 09:18:18 +0200
commitf2dcb8841e6b155da098edae09125859ef7e853d (patch)
tree195ada5679b5809f0a6c65fd7eab2bafa58ecb8f /drivers/staging
parentMerge tag 'iio-fixes-for-5.2a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus: (diff)
downloadlinux-dev-f2dcb8841e6b155da098edae09125859ef7e853d.tar.xz
linux-dev-f2dcb8841e6b155da098edae09125859ef7e853d.zip
staging: erofs: set sb->s_root to NULL when failing from __getname()
Set sb->s_root to NULL when failing from __getname(), so that we can avoid double dput and unnecessary operations in generic_shutdown_super(). Signed-off-by: Chengguang Xu <cgxu519@gmail.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Reviewed-by: Gao Xiang <gaoxiang25@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/erofs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
index 399847d21146..f580d4ef77a1 100644
--- a/drivers/staging/erofs/super.c
+++ b/drivers/staging/erofs/super.c
@@ -457,6 +457,7 @@ static int erofs_read_super(struct super_block *sb,
*/
err_devname:
dput(sb->s_root);
+ sb->s_root = NULL;
err_iget:
#ifdef EROFS_FS_HAS_MANAGED_CACHE
iput(sbi->managed_cache);