All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Cai Huoqing <caihuoqing@baidu.com>, mst@redhat.com
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free
Date: Fri, 18 Jun 2021 15:20:11 +0800	[thread overview]
Message-ID: <5f046ae5-2a1a-e843-bcae-f16ac0167c0e@redhat.com> (raw)
In-Reply-To: <20210618065307.183-1-caihuoqing@baidu.com>


在 2021/6/18 下午2:53, Cai Huoqing 写道:
> "v->vqs" and "v" don't free when "cdev_device_add" returns error
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>   drivers/vhost/vdpa.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index fb41db3da611..6e5d5df5ee70 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -1065,6 +1065,8 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
>   
>   err:
>          put_device(&v->dev);
> +       kfree(v->vqs);
> +       kfree(v);


Isn't this the charge of vhost_vdpa_release_dev()?

Thanks


>          return r;
>   }
>   


WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: Cai Huoqing <caihuoqing@baidu.com>, mst@redhat.com
Cc: netdev@vger.kernel.org, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free
Date: Fri, 18 Jun 2021 15:20:11 +0800	[thread overview]
Message-ID: <5f046ae5-2a1a-e843-bcae-f16ac0167c0e@redhat.com> (raw)
In-Reply-To: <20210618065307.183-1-caihuoqing@baidu.com>


在 2021/6/18 下午2:53, Cai Huoqing 写道:
> "v->vqs" and "v" don't free when "cdev_device_add" returns error
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>   drivers/vhost/vdpa.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index fb41db3da611..6e5d5df5ee70 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -1065,6 +1065,8 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
>   
>   err:
>          put_device(&v->dev);
> +       kfree(v->vqs);
> +       kfree(v);


Isn't this the charge of vhost_vdpa_release_dev()?

Thanks


>          return r;
>   }
>   

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-06-18  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  6:53 [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free Cai Huoqing
2021-06-18  7:20 ` Jason Wang [this message]
2021-06-18  7:20   ` Jason Wang

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=5f046ae5-2a1a-e843-bcae-f16ac0167c0e@redhat.com \
    --to=jasowang@redhat.com \
    --cc=caihuoqing@baidu.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.