]> Git Repo - linux.git/commitdiff
fuse: fix memleak in cuse_channel_open
authorzhengbin <[email protected]>
Wed, 14 Aug 2019 07:59:09 +0000 (15:59 +0800)
committerMiklos Szeredi <[email protected]>
Tue, 24 Sep 2019 13:28:01 +0000 (15:28 +0200)
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 <[email protected]>
Signed-off-by: zhengbin <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
fs/fuse/cuse.c

index 45762bb7a934e318bfb00da7dfef2349bfc0f1d0..00015d85138297b1c5e87158d75714e4a49a23dd 100644 (file)
@@ -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;
This page took 0.050753 seconds and 4 git commands to generate.