Commit 2c88c16d authored by Al Viro's avatar Al Viro

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7e4a205f
...@@ -381,11 +381,12 @@ static int erofs_fscache_init_domain(struct super_block *sb) ...@@ -381,11 +381,12 @@ static int erofs_fscache_init_domain(struct super_block *sb)
goto out; goto out;
if (!erofs_pseudo_mnt) { if (!erofs_pseudo_mnt) {
erofs_pseudo_mnt = kern_mount(&erofs_fs_type); struct vfsmount *mnt = kern_mount(&erofs_fs_type);
if (IS_ERR(erofs_pseudo_mnt)) { if (IS_ERR(mnt)) {
err = PTR_ERR(erofs_pseudo_mnt); err = PTR_ERR(mnt);
goto out; goto out;
} }
erofs_pseudo_mnt = mnt;
} }
domain->volume = sbi->volume; domain->volume = sbi->volume;
......
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