[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] 答复: [PATCH] vhost-user: fix memory leak
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] 答复: [PATCH] vhost-user: fix memory leak |
Date: |
Tue, 13 Feb 2018 01:30:45 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 02/13/2018 01:16 AM, linzhecheng wrote:
>> -----邮件原件-----
>> 发件人: Philippe Mathieu-Daudé [mailto:address@hidden
>> 代表 Philippe Mathieu-Daudé
>> 发送时间: 2018年2月13日 11:54
>> 收件人: linzhecheng <address@hidden>; address@hidden
>> 抄送: address@hidden; wangxin (U) <address@hidden>;
>> lidonglin <address@hidden>; address@hidden
>> 主题: Re: [Qemu-devel] [PATCH] vhost-user: fix memory leak
>>
>> Hi Linzhecheng,
>>
>> On 02/12/2018 11:53 PM, linzhecheng wrote:
>>> fix memory leak
>>>
>>> Signed-off-by: linzhecheng <address@hidden>
>>>
>>> diff --git a/net/vhost-user.c b/net/vhost-user.c index
>>> cb45512506..d024573e45 100644
>>> --- a/net/vhost-user.c
>>> +++ b/net/vhost-user.c
>>> @@ -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:
> I think your qemu version is out of date, g_free was moved from
> vhost_net_cleanup in 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:
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>>
>> void vhost_net_cleanup(struct vhost_net *net) {
>> vhost_dev_cleanup(&net->dev);
>> g_free(net);
>> }
>>
>> Regards,
>>
>> Phil.
>>
>>> }
>>> vhost_user_stop(i, ncs);
>>> return -1;
>>>