[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d412cbba-f2da-4622-87cd-7b3ea2bd5fa6@openvpn.net>
Date: Wed, 17 Jul 2024 16:05:48 +0200
From: Antonio Quartulli <antonio@...nvpn.net>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: netdev@...r.kernel.org, kuba@...nel.org, ryazanov.s.a@...il.com,
pabeni@...hat.com, edumazet@...gle.com, andrew@...n.ch
Subject: Re: [PATCH net-next v5 15/25] ovpn: implement multi-peer support
Hi,
On 15/07/2024 12:40, Sabrina Dubroca wrote:
> 2024-06-27, 15:08:33 +0200, Antonio Quartulli wrote:
>> @@ -46,6 +46,17 @@ static int ovpn_struct_init(struct net_device *dev, enum ovpn_mode mode)
>> ovpn->mode = mode;
>> spin_lock_init(&ovpn->lock);
>>
>> + if (mode == OVPN_MODE_MP) {
>> + /* the peer container is fairly large, therefore we dynamically
>> + * allocate it only when needed
>> + */
>> + ovpn->peers = kzalloc(sizeof(*ovpn->peers), GFP_KERNEL);
>> + if (!ovpn->peers)
>> + return -ENOMEM;
>
> As we discussed in v3 (it was about the workqueue), I don't think this
> will get freed correctly in some of the failure cases. This should go
> in ovpn_net_init.
Argh. Right. I will move it there.
>
>> +
>> + spin_lock_init(&ovpn->peers->lock);
>> + }
>> +
>> return 0;
>> }
>
Thanks!
--
Antonio Quartulli
OpenVPN Inc.
Powered by blists - more mailing lists