linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "zhengbin (A)" <zhengbin13@huawei.com>
To: <mszeredi@redhat.com>, <ashish.samant@oracle.com>,
	<miklos@szeredi.hu>, <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] fuse: fix memleak in cuse_channel_open
Date: Mon, 23 Sep 2019 14:26:33 +0800	[thread overview]
Message-ID: <ac291692-c851-1c39-8ce3-cbf91327e8a4@huawei.com> (raw)
In-Reply-To: <1565769549-127890-1-git-send-email-zhengbin13@huawei.com>

ping

On 2019/8/14 15:59, zhengbin wrote:
> 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 <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  fs/fuse/cuse.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
> index bab7a0d..f3b7208 100644
> --- a/fs/fuse/cuse.c
> +++ b/fs/fuse/cuse.c
> @@ -519,6 +519,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;
> --
> 2.7.4
>
>
> .
>


  parent reply	other threads:[~2019-09-23  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  7:59 [PATCH] fuse: fix memleak in cuse_channel_open zhengbin
2019-09-04  8:46 ` zhengbin (A)
2019-09-23  6:26 ` zhengbin (A) [this message]
2019-09-23  7:04 ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac291692-c851-1c39-8ce3-cbf91327e8a4@huawei.com \
    --to=zhengbin13@huawei.com \
    --cc=ashish.samant@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).