Skip to content

Commit 410d268

Browse files
zhengbin13gregkh
authored andcommitted
fuse: fix memleak in cuse_channel_open
[ Upstream commit 9ad09b1 ] 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: cc080e9 ("fuse: introduce per-instance fuse_dev structure") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 247272b commit 410d268

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/fuse/cuse.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file)
519519
rc = cuse_send_init(cc);
520520
if (rc) {
521521
fuse_dev_free(fud);
522+
fuse_conn_put(&cc->fc);
522523
return rc;
523524
}
524525
file->private_data = fud;

0 commit comments

Comments
 (0)