From: zhengbin Date: Wed, 14 Aug 2019 07:59:09 +0000 (+0800) Subject: fuse: fix memleak in cuse_channel_open X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9ad09b1976c562061636ff1e01bfc3a57aebe56b;p=linux.git fuse: fix memleak in cuse_channel_open 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: cc080e9e9be1 ("fuse: introduce per-instance fuse_dev structure") Reported-by: Hulk Robot Signed-off-by: zhengbin Signed-off-by: Miklos Szeredi --- diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c index 45762bb7a934e..00015d8513829 100644 --- a/fs/fuse/cuse.c +++ b/fs/fuse/cuse.c @@ -521,6 +521,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file) rc = cuse_send_init(cc); if (rc) { fuse_dev_free(fud); + fuse_conn_put(&cc->fc); return rc; } file->private_data = fud;