[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b2f69ff3-8340-2975-94bb-749416bf7873@redhat.com>
Date: Tue, 16 Jan 2018 14:37:39 +0800
From: Jason Wang <jasowang@...hat.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Dmitry Vyukov <dvyukov@...gle.com>
Subject: Re: [Patch net v3] tun: fix a memory leak for tfile->tx_array
On 2018年01月16日 14:33, Cong Wang wrote:
> On Mon, Jan 15, 2018 at 10:12 PM, Jason Wang <jasowang@...hat.com> wrote:
>>
>> On 2018年01月16日 14:07, Cong Wang wrote:
>>> On Mon, Jan 15, 2018 at 10:00 PM, Jason Wang <jasowang@...hat.com> wrote:
>>>> I mean we can leave __tun_detach() as is, and just add the cleanup to
>>>> tun_detach_all(). This is because in both cases, we're sure skb array has
>>>> been initialized before.
>>>>
>>> Oh, I thought the same before sending v3, but I believe it is easier to
>>> understand 'if (tfile->tx_array.ring.queue)' than 'if (tun)', because
>>> tx_array
>>> only depends on itself rather tfile->tun in this way.
>>
>> Maybe just add a comment to explain in __tun_detach(), it avoids memset()
>> anyway.
>>
> But __tun_detach(true) is not a hot path, a memset() doesn't harm anything.
Yes, but it looks more more like a workaround or trick to me.
Thanks
Powered by blists - more mailing lists