summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-02-12 22:44:11 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2024-02-20 02:09:02 -0500
commit2c88c16dc20e88dd54d2f6f4d01ae1dce6cc9654 (patch)
treebe221a16f9ef29e552d71b6c1fbd4eec33e9424c /fs
parent7e4a205fe56b9092f0143dad6aa5fee081139b09 (diff)
erofs: fix handling kern_mount() failure
if you have a variable that holds NULL or a pointer to live struct mount, do not shove ERR_PTR() into it - not if you later treat "not NULL" as "holds a pointer to object". Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/erofs/fscache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
index bc12030393b2..29ad5b1cc7fd 100644
--- a/fs/erofs/fscache.c
+++ b/fs/erofs/fscache.c
@@ -381,11 +381,12 @@ static int erofs_fscache_init_domain(struct super_block *sb)
goto out;
if (!erofs_pseudo_mnt) {
- erofs_pseudo_mnt = kern_mount(&erofs_fs_type);
- if (IS_ERR(erofs_pseudo_mnt)) {
- err = PTR_ERR(erofs_pseudo_mnt);
+ struct vfsmount *mnt = kern_mount(&erofs_fs_type);
+ if (IS_ERR(mnt)) {
+ err = PTR_ERR(mnt);
goto out;
}
+ erofs_pseudo_mnt = mnt;
}
domain->volume = sbi->volume;