mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
UPSTREAM: virtiofs fix leak in setup
[ Upstream commit 66ab33bf6d4341574f88b511e856a73f6f2a921e ]
This can be triggered for example by adding the "-omand" mount option,
which will be rejected and virtio_fs_fill_super() will return an error.
In such a case the allocations for fuse_conn and fuse_mount will leak due
to s_root not yet being set and so ->put_super() not being called.
Fixes: a62a8ef9d9 ("virtio-fs: add virtiofs filesystem")
Change-Id: I1a25fd72aaf8348e8bd1ca29b59df712d789e3f7
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0da478369b
commit
507c24a3c3
1 changed files with 2 additions and 0 deletions
|
|
@ -1482,6 +1482,8 @@ static int virtio_fs_get_tree(struct fs_context *fsc)
|
|||
if (!sb->s_root) {
|
||||
err = virtio_fs_fill_super(sb, fsc);
|
||||
if (err) {
|
||||
fuse_mount_put(fm);
|
||||
sb->s_fs_info = NULL;
|
||||
deactivate_locked_super(sb);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue