vhost-user: fix memory leak
PATCH 1/1 vhost-user: fix memory leak
fix memory leak
net/vhost-user.c +1 -0
@@ -109,6 +109,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) err:if (net) {vhost_net_cleanup (net); +g_free (net); }vhost_user_stop (i, ncs);return -1 ;
Signature · 1 line
2.12.2.windows.2
Hi Linzhecheng,
net/vhost-user.c static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) · line 112
Quoted 13 lines · linzhecheng
fix memory leak
Signed-off-by linzhecheng <[email protected]>net/vhost-user.c +1
-0@@ -109,6 +109,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) err:if (net) {vhost_net_cleanup (net); +g_free (net);
I think this g_free() belongs to vhost_net_cleanup() in net/vhost_net.c:
void vhost_net_cleanup(struct vhost_net *net)
{
vhost_dev_cleanup(&net->dev);
g_free(net);
}Regards,
Phil.
Quoted 4 lines
net/vhost-user.c +0
-0}vhost_user_stop (i, ncs);return -1 ;
Quoted 18 lines
-----邮件原件-----
发件人: Philippe Mathieu-Daudé [mailto:[email protected]] 代表 Philippe Mathieu-Daudé
发送时间: 2018年2月13日 11:54
收件人: linzhecheng <[email protected]>; [email protected] 抄送: [email protected]; wangxin (U) <[email protected]>; lidonglin <[email protected]>; [email protected]
主题: Re: [Qemu-devel] [PATCH] vhost-user: fix memory leakHi Linzhecheng,
Quoted 4 lines · linzhecheng
fix memory leak
Signed-off-by linzhecheng <[email protected]>
Quoted 12 lines
net/vhost-user.c static int vhost_user_start(int queues, · line 113
Quoted 10 lines
net/vhost-user.c index renamed from net/vhost-user.c +0
-0
cb45512506..d024573e45100644net/vhost-user.c +1
-0@@ -109,6 +109,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) err: if (net) {vhost_net_cleanup (net ); +g_free (net);I think this
g_free()belongs tovhost_net_cleanup()innet/vhost_net.c:
I think your qemu version is out of date, g_free was moved from vhost_net_cleanup in commit e6bcb1b
Quoted 14 lines
void vhost_net_cleanup(struct vhost_net *net) { vhost_dev_cleanup(&net->dev); g_free(net); }Regards,
Phil.
Quoted 4 lines
net/vhost-user.c +0
-0}vhost_user_stop (i, ncs);return -1;
Philippe Mathieu-Daudé
Reviewed-byQuoted 28 lines · linzhecheng
Quoted 16 lines
-----邮件原件-----
发件人: Philippe Mathieu-Daudé [mailto:[email protected]] 代表 Philippe Mathieu-Daudé
发送时间: 2018年2月13日 11:54
收件人: linzhecheng <[email protected]>; [email protected] 抄送: [email protected]; wangxin (U) <[email protected]>; lidonglin <[email protected]>; [email protected]
主题: Re: [Qemu-devel] [PATCH] vhost-user: fix memory leakHi Linzhecheng,
Quoted 4 lines · linzhecheng
fix memory leak
Signed-off-by linzhecheng <[email protected]>Quoted 12 lines
net/vhost-user.c static int vhost_user_start(int queues, · line 113
Quoted 10 lines
net/vhost-user.c index renamed from net/vhost-user.c +0
-0
cb45512506..d024573e45100644net/vhost-user.c +1
-0@@ -109,6 +109,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) err: if (net) {vhost_net_cleanup (net ); +g_free (net);I think this
g_free()belongs tovhost_net_cleanup()innet/vhost_net.c:
Quoted 1 line
I think your qemu version is out of date,
g_freewas moved fromvhost_net_cleanupin commit e6bcb1b
Now reading e6bcb1b I can understand your patch.
Can you add a reference to this commit in your patch description?
"g_free was moved from vhost_net_cleanup in commit e6bcb1b" might be enough.
Adding reference:
Quoted 14 lines
Quoted 14 lines
void vhost_net_cleanup(struct vhost_net *net) { vhost_dev_cleanup(&net->dev); g_free(net); }Regards,
Phil.
Quoted 4 lines
net/vhost-user.c +0
-0}vhost_user_stop (i, ncs);return -1;