* [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free
@ 2021-06-18 6:53 Cai Huoqing
2021-06-18 7:20 ` Jason Wang
0 siblings, 1 reply; 3+ messages in thread
From: Cai Huoqing @ 2021-06-18 6:53 UTC (permalink / raw)
To: mst, jasowang; +Cc: kvm, virtualization, netdev, 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);
return r;
}
--
2.22.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free
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
0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2021-06-18 7:20 UTC (permalink / raw)
To: Cai Huoqing, mst; +Cc: kvm, virtualization, netdev
在 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;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free
@ 2021-06-18 7:20 ` Jason Wang
0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2021-06-18 7:20 UTC (permalink / raw)
To: Cai Huoqing, mst; +Cc: netdev, kvm, virtualization
在 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-18 7:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-06-18 7:20 ` Jason Wang
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.