提交 3ddf1e7f 编写于 作者: M Miklos Szeredi 提交者: Miklos Szeredi

fuse: fix missing fput on error

Fix the leaking file reference if allocation or initialization of
fuse_conn failed.
Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
CC: stable@kernel.org
上级 bb875b38
......@@ -829,15 +829,20 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
if (!file)
return -EINVAL;
if (file->f_op != &fuse_dev_operations)
if (file->f_op != &fuse_dev_operations) {
fput(file);
return -EINVAL;
}
fc = kmalloc(sizeof(*fc), GFP_KERNEL);
if (!fc)
if (!fc) {
fput(file);
return -ENOMEM;
}
err = fuse_conn_init(fc, sb);
if (err) {
fput(file);
kfree(fc);
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册