提交 66ab33bf 编写于 作者: M Miklos Szeredi

virtiofs fix leak in setup

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: a62a8ef9 ("virtio-fs: add virtiofs filesystem")
Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
上级 3993382b
......@@ -1464,6 +1464,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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册