mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
erofs: fix handling kern_mount() failure
[ Upstream commit2c88c16dc2
] 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> Stable-dep-of:0f28be64d1
("erofs: fix lockdep false positives on initializing erofs_pseudo_mnt") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3dd9bef2b8
commit
9337fc461c
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue