提交 d6245406 编写于 作者: Z zhengbin 提交者: Xie XiuQi

fuse: fix memleak in cuse_channel_open

hulk inclusion
category: bugfix
bugzilla: 20220
CVE: NA

---------------------------

If cuse_send_init fails, need to fuse_conn_put cc->fc.

cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1)
                 ->fuse_dev_alloc->fuse_conn_get
                 ->fuse_dev_free->fuse_conn_put

Fixes: cc080e9e ("fuse: introduce per-instance fuse_dev structure")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: Nzhengbin <zhengbin13@huawei.com>
Reviewed-by: Nluojiajun <luojiajun3@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ec8f896f
...@@ -518,6 +518,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file) ...@@ -518,6 +518,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file)
rc = cuse_send_init(cc); rc = cuse_send_init(cc);
if (rc) { if (rc) {
fuse_dev_free(fud); fuse_dev_free(fud);
fuse_conn_put(&cc->fc);
return rc; return rc;
} }
file->private_data = fud; file->private_data = fud;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册