Re: [B.A.T.M.A.N.] [RFC 07/23] batman-adv: OGMv2 - add basic infrastructure

Antonio Quartulli
2014-02-12T07:58:50Z

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

On 12/02/14 08:44, Andrew Lunn wrote:
>>>> + bat_priv->bat_v.ogm_buff_len = BATADV_OGM2_HLEN;
>>>> + ogm_buff = kmalloc(bat_priv->bat_v.ogm_buff_len, GFP_ATOMIC);
>>>
>>> Maybe use kzalloc to ensure it is zero?
>>
>> Not really needed because each field is explicitly assigned later. But
>> to be sure we sit on the safe side we can do that: in the end we are not
>> in the fastpath here.
>
> I know some of your structures have explicit align bytes. It would be
> good to ensure they are zero so that they could be used in the future
> without having a protocol version bump. So i think it is a good
> patterns to follow in general when not on the fast path.

True. _I_ had this problem in the past already :-)
I'll use kzalloc then!

Thanks!

>
> Andrew
>

--
Antonio Quartulli

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]